Skip to content

Commit

Permalink
chore(types): add more api errors (#3687)
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain authored Oct 13, 2024
1 parent a3103a5 commit 0432939
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/types/src/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ export class ApiErrorUnknown extends Error {}
export class ApiErrorNetwork extends Error {}
export class ApiErrorInvalidState extends Error {}
export class ApiErrorResponseMalformed extends Error {}
export class ApiErrorServiceUnavailable extends Error {}
export class ApiErrorMethodNotAllowed extends Error {}
export class ApiErrorContentNotAcceptable extends Error {}
3 changes: 3 additions & 0 deletions packages/types/src/api/status-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export enum ApiHttpStatusCode {
Unauthorized = 401,
Forbidden = 403,
NotFound = 404,
MethodNotAllowed = 405,
ContentNotAcceptable = 406,
TooEarly = 425,
TooManyRequests = 429,
InternalServerError = 500,
ServiceUnavailable = 503,
}

0 comments on commit 0432939

Please sign in to comment.