mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
12 lines
391 B
TypeScript
12 lines
391 B
TypeScript
export const isErrorCode = (code: unknown): code is ErrorCode => {
|
|
return typeof code === 'string' && code in ErrorCode;
|
|
};
|
|
|
|
export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
|
|
export const ErrorCode = {
|
|
INCORRECT_EMAIL_PASSWORD: 'INCORRECT_EMAIL_PASSWORD',
|
|
USER_MISSING_PASSWORD: 'USER_MISSING_PASSWORD',
|
|
CREDENTIALS_NOT_FOUND: 'CREDENTIALS_NOT_FOUND',
|
|
} as const;
|