UNPKG

@storm-stack/errors

Version:

This package includes a base error class and various utility functions for working with errors.

16 lines (15 loc) 486 B
import { ErrorType } from "../types"; /** * Get the default error code for the given error type. * * @param type - The error type. * @returns The default error code. */ export declare function getDefaultCodeFromType<TCode extends string = string>(type: ErrorType): TCode; /** * Get the default error name for the given error type. * * @param type - The error type. * @returns The default error name. */ export declare function getDefaultNameFromType(type: ErrorType): string;