Skip to content

Commit

Permalink
refactor: make error extends architect
Browse files Browse the repository at this point in the history
  • Loading branch information
poiu694 committed Jun 28, 2024
1 parent 70a4d0e commit 5382159
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/models/interface.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5382159

Please sign in to comment.