mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
BaseClient: pass captureRejections option (#7288)
This commit is contained in:
@@ -13,7 +13,7 @@ const Util = require('../util/Util');
|
||||
*/
|
||||
class BaseClient extends EventEmitter {
|
||||
constructor(options = {}) {
|
||||
super();
|
||||
super({ captureRejections: true });
|
||||
|
||||
if (typeof options !== 'object' || options === null) {
|
||||
throw new TypeError('INVALID_TYPE', 'options', 'object', true);
|
||||
|
||||
@@ -210,6 +210,9 @@ class ShardClientUtil {
|
||||
error.stack = err.stack;
|
||||
/**
|
||||
* Emitted when the client encounters an error.
|
||||
* <warn>Errors thrown within this event do not have a catch handler, it is
|
||||
* recommended to not use async functions as `error` event handlers. See the
|
||||
* [Node.js docs](https://nodejs.org/api/events.html#capture-rejections-of-promises) for details.</warn>
|
||||
* @event Client#error
|
||||
* @param {Error} error The error encountered
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user