refactor(core): standardize frontend error handling (#10667)
This commit is contained in:
@@ -10,6 +10,12 @@ export class InternalServerError extends UserFriendlyError {
|
||||
}
|
||||
}
|
||||
|
||||
export class NetworkError extends UserFriendlyError {
|
||||
constructor(message?: string) {
|
||||
super('network_error', 'network_error', message);
|
||||
}
|
||||
}
|
||||
|
||||
export class TooManyRequest extends UserFriendlyError {
|
||||
constructor(message?: string) {
|
||||
super('too_many_requests', 'too_many_request', message);
|
||||
@@ -851,6 +857,7 @@ export class UnsupportedClientVersion extends UserFriendlyError {
|
||||
}
|
||||
export enum ErrorNames {
|
||||
INTERNAL_SERVER_ERROR,
|
||||
NETWORK_ERROR,
|
||||
TOO_MANY_REQUEST,
|
||||
NOT_FOUND,
|
||||
BAD_REQUEST,
|
||||
|
||||
Reference in New Issue
Block a user