webapp/src/graphql/error.ts

17 lines
308 B
TypeScript
Raw Normal View History

2023-11-28 13:18:25 +00:00
type ApiErrorCode =
| 'unknown'
| 'email_not_confirmed'
| 'user_not_found'
| 'user_already_exists'
| 'token_expired'
| 'token_invalid'
export class ApiError extends Error {
code: ApiErrorCode
constructor(code: ApiErrorCode, message?: string) {
super(message)
this.code = code
}
}