Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/__tests__/linkup-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,19 @@ describe('LinkupClient', () => {
statusCode: 429,
},
},
{
description: '429 EXCEED_BUDGET_LIMIT',
ErrorClass: LinkupInsufficientCreditError,
expectedMessage: 'The API key has reached its budget limit.',
input: {
error: {
code: 'EXCEED_BUDGET_LIMIT',
details: [],
message: 'The API key has reached its budget limit.',
},
statusCode: 429,
},
},
{
description: '429 TOO_MANY_REQUESTS',
ErrorClass: LinkupTooManyRequestsError,
Expand Down
1 change: 1 addition & 0 deletions src/utils/refine-error.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const refineError = (e: LinkupApiError): LinkupError => {
case 429:
switch (code) {
case 'INSUFFICIENT_FUNDS_CREDITS':
case 'EXCEED_BUDGET_LIMIT':
return new LinkupInsufficientCreditError(message);
case 'TOO_MANY_REQUESTS':
return new LinkupTooManyRequestsError(message);
Expand Down