mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
@@ -101,6 +101,15 @@ export class UserFriendlyError extends Error {
|
||||
this.requestId = ClsServiceManager.getClsService()?.getId();
|
||||
}
|
||||
|
||||
static fromUserFriendlyErrorJSON(body: UserFriendlyError) {
|
||||
return new UserFriendlyError(
|
||||
body.type as UserFriendlyErrorBaseType,
|
||||
body.name.toLowerCase() as keyof typeof USER_FRIENDLY_ERRORS,
|
||||
body.message,
|
||||
body.data
|
||||
);
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
status: this.status,
|
||||
|
||||
Reference in New Issue
Block a user