@monstermann/fn
Version:
A utility library for TypeScript.
22 lines (21 loc) • 513 B
JavaScript
//#region src/function/FnError.ts
/**
* `FnError(message, args)`
*
* A custom error class that extends the standard Error class with additional argument storage.
*
* This is the exception that gets thrown in `xOrThrow` utilities.
*
* ```ts
* const error = new FnError("Something went wrong", [1, 2, 3]);
* console.log(error.message); // "Something went wrong"
*/
var FnError = class extends Error {
args;
constructor(message, args) {
super(message);
this.args = args;
}
};
//#endregion
export { FnError };