spec(backend): IdentifiableErrorの場合もエラーメッセージが正常に表示されるように (MisskeyIO#463)
This commit is contained in:
parent
82cc3987c1
commit
4eb645403f
9 changed files with 67 additions and 37 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue