Handle error 1006 (Connection reset by peer) gracefully
parent
012bd5b9b2
commit
ccd56a1d88
10
src/bot.js
10
src/bot.js
|
@ -27,6 +27,16 @@ const bot = new Eris.Client(config.token, {
|
|||
},
|
||||
});
|
||||
|
||||
bot.on("error", err => {
|
||||
if (err.code === 1006) {
|
||||
// 1006 = "Connection reset by peer"
|
||||
// Eris allegedly handles this internally, so we can ignore it
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {Eris.Client}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue