UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

31 lines (30 loc) 801 B
//#region src/lib/errors/UserError.ts /** * The UserError class to be emitted in the pieces. * @property name This will be `'UserError'` and can be used to distinguish the type of error when any error gets thrown * @example * ```typescript * throw new UserError({ * identifier: 'AddArgumentError', * message: 'You must write two numbers, but the second one did not match.', * context: { received: 2, expected: 3 } * }); * ``` */ var UserError = class extends Error { /** * Constructs an UserError. * @param options The UserError options */ constructor(options) { super(options.message); this.identifier = options.identifier; this.context = options.context ?? null; } get name() { return "UserError"; } }; //#endregion export { UserError }; //# sourceMappingURL=UserError.mjs.map