17 lines
435 B
TypeScript
17 lines
435 B
TypeScript
/**
|
|
* @deprecated Use error codes in Result instead of throwing ApplicationError.
|
|
*/
|
|
export type CommonApplicationErrorKind =
|
|
| 'not_found'
|
|
| 'forbidden'
|
|
| 'conflict'
|
|
| 'validation'
|
|
| 'unknown'
|
|
| string;
|
|
|
|
export interface IApplicationError<K extends string = CommonApplicationErrorKind, D = unknown> extends Error {
|
|
readonly type: 'application';
|
|
readonly context: string;
|
|
readonly kind: K;
|
|
readonly details?: D;
|
|
} |