Skip to content

Commit

Permalink
fix(opapi): include HTTP 424 in ApiError.status and add type guard (#511
Browse files Browse the repository at this point in the history
)
  • Loading branch information
AbrahamLopez10 authored Dec 18, 2024
1 parent a5c68e6 commit 3758b73
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion opapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bpinternal/opapi",
"version": "0.11.0",
"version": "0.11.1",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion opapi/src/generators/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const codes = {
HTTP_STATUS_BAD_GATEWAY: 502,
HTTP_STATUS_SERVICE_UNAVAILABLE: 503,
HTTP_STATUS_GATEWAY_TIMEOUT: 504,
} as const
} as const satisfies Record<string, ApiError['status']>

export function generateErrors(errors: ApiError[]) {
const types = errors.map((error) => error.type)
Expand Down
2 changes: 1 addition & 1 deletion opapi/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const internalError: ApiError = {
}

export type ApiError = {
status: 400 | 401 | 402 | 403 | 404 | 405 | 408 | 409 | 413 | 415 | 429 | 500 | 501 | 502 | 503 | 504
status: 400 | 401 | 402 | 403 | 404 | 405 | 408 | 409 | 413 | 415 | 424 | 429 | 500 | 501 | 502 | 503 | 504
type: string
description: string
}
Expand Down

0 comments on commit 3758b73

Please sign in to comment.