Skip to content

Commit

Permalink
Merge pull request #90 from nginformatica/feat/add-too-many-requests-…
Browse files Browse the repository at this point in the history
…error

feat: add too many requests error
  • Loading branch information
jacksjm authored Jun 8, 2023
2 parents 028124f + f155790 commit 964f607
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quirons-broker",
"version": "0.0.1-alpha.107",
"version": "0.0.1-alpha.108",
"description": "A small library to expose the broker types",
"main": "index.ts",
"typings": "index.d.ts",
Expand Down
8 changes: 7 additions & 1 deletion src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const ErrorCodeKey = t.keyof({
REQUIRED_BRANCH_ID: null,
REQUIRED_ID_PARAMETER: null,
BAD_REQUEST: null,
DECODED_ERROR: null
DECODED_ERROR: null,
TOO_MANY_REQUESTS: null
})

type ErrorCode = t.TypeOf<typeof ErrorCodeKey>
Expand Down Expand Up @@ -68,6 +69,11 @@ const errorInfoWith = (payload = ''): Record<ErrorCode, ErrorInfo> => ({
status: 400,
message: 'Decoded error message',
detailedMessage: 'The message sent is outside the established format'
},
TOO_MANY_REQUESTS: {
status: 429,
message: 'Too many requests',
detailedMessage: 'You have exceeded the request limits, please wait and try again later.'
}
})

Expand Down

0 comments on commit 964f607

Please sign in to comment.