diff --git a/src/models/interface.ts b/src/models/interface.ts index 28102a68..903e11cd 100644 --- a/src/models/interface.ts +++ b/src/models/interface.ts @@ -1,20 +1,14 @@ export interface APIErrorType {} -export class APIError extends Error { - constructor({ name, message }: { name: string; message: string }) { - super(message) - this.name = name - this.message = message - } -} - -export class ParseJSONError extends Error { +class ErrorNameMessage extends Error { constructor({ name, message }: { name: string; message: string }) { super(message) this.name = name this.message = message } } +export class APIError extends ErrorNameMessage {} +export class ParseJSONError extends ErrorNameMessage {} export interface ResponseOk { ok: boolean