requestを使うのをやめるなど (#145)

* got

* Accept-Language

* Remove unused import

* fix

* Remove junk
This commit is contained in:
MeiMei
2021-12-17 13:14:41 +09:00
committed by GitHub
parent 37099447b3
commit 6b918be692
9 changed files with 653 additions and 1463 deletions

13
src/utils/status-error.ts Normal file
View 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;
}
}