Skip to content

Commit

Permalink
AAP-29861: WCA: Handle 'HTTP404: Failed to get remaining capacity' re…
Browse files Browse the repository at this point in the history
…sponse (#1519)
  • Loading branch information
manstis authored Aug 27, 2024
1 parent 41e9f2e commit 7b16899
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/features/lightspeed/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ ERRORS.addError(
),
);

ERRORS.addError(
418,
new Error(
"error__wca_instance_deleted",
"IBM watsonx Code Assistant instance associated with your Model Id has been deleted. Please contact your administrator.",
),
);

ERRORS.addError(
500,
new Error(
Expand Down
16 changes: 16 additions & 0 deletions test/units/lightspeed/utils/handleApiError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@ describe("testing the error handling", () => {
});
// =================================

// =================================
// HTTP 418
// ---------------------------------
it("err WCA instance deleted", () => {
const error = mapError(
createError(418, {
code: "error__wca_instance_deleted",
}),
);
assert.equal(
error.message,
"IBM watsonx Code Assistant instance associated with your Model Id has been deleted. Please contact your administrator.",
);
});
// =================================

// =================================
// HTTP 429
// ---------------------------------
Expand Down

0 comments on commit 7b16899

Please sign in to comment.