mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-08-08 01:03:55 +09:00
15 lines
471 B
TypeScript
15 lines
471 B
TypeScript
export class StatusError extends Error {
|
|
public name: string;
|
|
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;
|
|
}
|
|
}
|