-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(/api/0.6/changeset/create): error handler
- Loading branch information
Showing
7 changed files
with
63 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { AxiosError } from "axios"; | ||
|
||
class HttpErrorHandler extends Error { | ||
public constructor(error: AxiosError) { | ||
super(error.response?.data); | ||
Object.setPrototypeOf(this, HttpErrorHandler.prototype); | ||
} | ||
} | ||
|
||
export class Unauthorized extends HttpErrorHandler { | ||
public constructor(error: AxiosError) { | ||
super(error); | ||
Object.setPrototypeOf(this, Unauthorized.prototype); | ||
} | ||
} | ||
|
||
export class BADXml extends HttpErrorHandler { | ||
public constructor(error: AxiosError) { | ||
super(error); | ||
Object.setPrototypeOf(this, BADXml.prototype); | ||
} | ||
} | ||
|
||
export class InternalServerError extends HttpErrorHandler { | ||
public constructor(error: AxiosError) { | ||
super(error); | ||
Object.setPrototypeOf(this, InternalServerError.prototype); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters