refactor(core): standardize frontend error handling (#10667)

This commit is contained in:
forehalo
2025-03-06 13:10:18 +00:00
parent 2e86bfffae
commit e02fb4fa94
70 changed files with 495 additions and 480 deletions

View File

@@ -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,