refactor: remove unused error in catch statements (#3820)

* refactor(handlers): remove unused error in catch

* refactor(PacketHandler): remove unused error

* refactor(SecretBox): remove unused error

* refactor(ClientPresence): remove unused error

* style: remove space

Co-Authored-By: Crawl <icrawltogo@gmail.com>

Co-authored-by: Crawl <icrawltogo@gmail.com>
This commit is contained in:
Sugden
2020-02-24 17:15:38 +00:00
committed by GitHub
parent 98a552107e
commit 0a1b9a5285
4 changed files with 4 additions and 4 deletions

View File

@@ -90,7 +90,7 @@ class PacketHandler extends EventEmitter {
this.connection.onSpeaking({ user_id: userStat.userID, ssrc: ssrc, speaking: 0 });
this.receiver.connection.client.clearTimeout(speakingTimeout);
this.speakingTimeouts.delete(ssrc);
} catch (ex) {
} catch {
// Connection already closed, ignore
}
}, DISCORD_SPEAKING_DELAY);

View File

@@ -27,6 +27,6 @@ exports.methods = {};
if (libName === 'libsodium-wrappers' && lib.ready) await lib.ready; // eslint-disable-line no-await-in-loop
exports.methods = libs[libName](lib);
break;
} catch (err) {} // eslint-disable-line no-empty
} catch {} // eslint-disable-line no-empty
}
})();

View File

@@ -7,7 +7,7 @@ const handlers = {};
for (const name of Object.keys(WSEvents)) {
try {
handlers[name] = require(`./${name}.js`);
} catch (err) {} // eslint-disable-line no-empty
} catch {} // eslint-disable-line no-empty
}
module.exports = handlers;

View File

@@ -39,7 +39,7 @@ class ClientPresence extends Presence {
try {
const a = await this.client.api.oauth2.applications(applicationID).assets.get();
for (const asset of a) assets.set(asset.name, asset.id);
} catch (err) { } // eslint-disable-line no-empty
} catch {} // eslint-disable-line no-empty
}
}