@speckle/shared
Version:
Shared code between various Speckle JS packages
28 lines • 1.11 kB
TypeScript
declare class UnexpectedErrorStructureError extends Error {
}
/**
* In JS catch clauses can receive not only Errors, but pretty much any other kind of data type, so
* you can use this helper to ensure that whatever is passed in is a real error
*/
export declare function ensureError(e: unknown, fallbackMessage?: string): Error | UnexpectedErrorStructureError;
export declare function throwUncoveredError(e: never): never;
export declare class UncoveredError extends Error {
}
export declare function createUncoveredError(e: unknown): UncoveredError;
/**
* A custom error class that produces a cleaner stack trace when instantiated.
*/
export declare class CleanStackTrace extends Error {
constructor();
}
/**
* Note: Only V8 and Node.js support controlling the stack trace limit
*/
export declare const collectLongTrace: (limit?: number) => string;
/**
* When you need to log a full error representation, w/ full .cause() support
*/
export declare const errorToString: (e: unknown) => string;
export declare const getErrorMessage: (e: unknown) => string;
export {};
//# sourceMappingURL=error.d.ts.map