Skip to content

Commit b76ea7d

Browse files
refactor: update query generation error message COMPASS-7257 (#4907)
1 parent 91ec641 commit b76ea7d

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

packages/compass-components/src/components/generative-ai/generative-ai-input.spec.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('GenerativeAIInput Component', function () {
101101
],
102102
[
103103
'QUERY_GENERATION_FAILED',
104-
'Something went wrong, please try again later. If the error persists, try changing your prompt.',
104+
'Sorry, we were unable to generate the query, please try again. If the error persists, try changing your prompt.',
105105
],
106106
].forEach(([errorCode, expectedText]) => {
107107
it(`renders an error for ${errorCode}`, function () {
@@ -135,7 +135,7 @@ describe('GenerativeAIInput Component', function () {
135135

136136
const errorMsg = screen.getByTestId('ai-error-msg');
137137
expect(errorMsg).to.have.text(
138-
'Something went wrong, please try again later. If the error persists, contact our support team.'
138+
'Sorry, we were unable to generate the query, please try again. If the error persists, try changing your prompt.'
139139
);
140140
expect(errorMsg).to.be.visible;
141141
});

packages/compass-components/src/components/generative-ai/generative-ai-input.tsx

+2-11
Original file line numberDiff line numberDiff line change
@@ -416,20 +416,11 @@ const AIError = ({
416416
);
417417
}
418418

419-
if (errorCode === 'QUERY_GENERATION_FAILED') {
420-
return (
421-
<>
422-
Something went wrong, please try again later. If the error persists, try
423-
changing your prompt.
424-
</>
425-
);
426-
}
427-
428419
// We received an errorCode that is not actionable (INTERNAL_SERVER_ERROR, QUERY_GENERATION_FAILED), or unknown.
429420
return (
430421
<>
431-
Something went wrong, please try again later. If the error persists,
432-
contact our support team.
422+
Sorry, we were unable to generate the query, please try again. If the
423+
error persists, try changing your prompt.
433424
</>
434425
);
435426
};

packages/compass-e2e-tests/tests/collection-ai-query.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('Collection ai query', function () {
159159
);
160160
await errorBanner.waitForDisplayed();
161161
expect(await errorBanner.getText()).to.equal(
162-
'Something went wrong, please try again later. If the error persists, contact our support team.'
162+
'Sorry, we were unable to generate the query, please try again. If the error persists, try changing your prompt.'
163163
);
164164
});
165165
});

0 commit comments

Comments
 (0)