UNPKG

@biskyjs/framework

Version:
46 lines 1.25 kB
/** * 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 */ export declare class UserError extends Error { /** * An identifier, useful to localize emitted errors. */ readonly identifier: string; /** * User-provided context. */ readonly context: unknown; /** * Constructs an UserError. * @param type The identifier, useful to localize emitted errors. * @param message The error message. */ constructor(options: UserError.Options); get name(): string; } export declare namespace UserError { /** * The options for {@link UserError}. * @since 1.0.0 */ interface Options { /** * The identifier for this error. * @since 1.0.0 */ identifier: string; /** * The message to be passed to the Error constructor. * @since 1.0.0 */ message?: string; /** * The extra context to provide more information about this error. * @since 1.0.0 * @default null */ context?: unknown; } } //# sourceMappingURL=user.d.ts.map