mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-27 23:40:28 +05:30
19 lines
445 B
TypeScript
19 lines
445 B
TypeScript
export default class RequestAbortedError extends Error {
|
|
private error: Error | Response;
|
|
|
|
constructor(error: Error | Response) {
|
|
super();
|
|
|
|
this.name = this.constructor.name;
|
|
this.message = this.constructor.name;
|
|
this.stack = new Error().stack;
|
|
|
|
if ('message' in error) {
|
|
this.message = error.message;
|
|
}
|
|
|
|
this.error = error;
|
|
Object.assign(this, error);
|
|
}
|
|
}
|