@dvcol/common-utils
Version:
Typescript library for common utility functions and constants
23 lines (21 loc) • 848 B
TypeScript
declare const enum ErrorTypes {
/**
* Parsing errors are thrown when the router cannot compute a relative path.
*/
PARSING_RELATIVE_PATH_ERROR = "PARSING_RELATIVE_PATH_ERROR"
}
type ParsingErrorTypes = ErrorTypes.PARSING_RELATIVE_PATH_ERROR;
declare class ParsingError<E = unknown> extends Error {
readonly type: ParsingErrorTypes;
readonly error?: E;
constructor(type: ParsingErrorTypes, error: E, message?: string);
}
type ParsingRelativePathErrorPayload = {
parent?: string;
relative?: string;
};
declare class ParsingRelativePathError extends ParsingError<ParsingRelativePathErrorPayload> {
readonly type: ErrorTypes.PARSING_RELATIVE_PATH_ERROR;
constructor({ parent, relative }: ParsingRelativePathErrorPayload, message?: string);
}
export { ErrorTypes, ParsingError, ParsingRelativePathError };