spec(backend): IdentifiableErrorの場合もエラーメッセージが正常に表示されるように (MisskeyIO#463)

This commit is contained in:
まっちゃとーにゅ 2024-02-18 06:21:58 +09:00 committed by GitHub
parent 82cc3987c1
commit 4eb645403f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 67 additions and 37 deletions

View file

@ -13,15 +13,7 @@ export class ApiError extends Error {
public httpStatusCode?: number;
public info?: any;
constructor(err?: E | null | undefined, info?: any | null | undefined) {
if (err == null) err = {
message: 'Internal error occurred. Please contact us if the error persists.',
code: 'INTERNAL_ERROR',
id: '5d37dbcb-891e-41ca-a3d6-e690c97775ac',
kind: 'server',
httpStatusCode: 500,
};
constructor(err: E, info?: any | null | undefined) {
super(err.message);
this.message = err.message;
this.code = err.code;