mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-08-08 09:14:02 +09:00
requestを使うのをやめるなど (#145)
* got * Accept-Language * Remove unused import * fix * Remove junk
This commit is contained in:
13
src/utils/status-error.ts
Normal file
13
src/utils/status-error.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export class StatusError extends Error {
|
||||
public statusCode: number;
|
||||
public statusMessage?: string;
|
||||
public isPermanentError: boolean;
|
||||
|
||||
constructor(message: string, statusCode: number, statusMessage?: string) {
|
||||
super(message);
|
||||
this.name = 'StatusError';
|
||||
this.statusCode = statusCode;
|
||||
this.statusMessage = statusMessage;
|
||||
this.isPermanentError = typeof this.statusCode === 'number' && this.statusCode >= 400 && this.statusCode < 500;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user