Skip to content

Commit b9239d4

Browse files
committed
lint errors
1 parent a3a3894 commit b9239d4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/core/src/amazonqTest/chat/controller/controller.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
TelemetryHelper,
2121
TestGenerationBuildStep,
2222
testGenState,
23+
tooManyRequestErrorMessage,
2324
unitTestGenerationCancelMessage,
2425
} from '../../../codewhisperer'
2526
import {
@@ -284,16 +285,14 @@ export class TestController {
284285
)
285286
} else {
286287
getLogger().error('Too many requests.')
287-
// TODO: move to constants file
288-
return this.messenger.sendErrorMessage('Too many requests. Please wait before retrying.', tabID)
288+
return this.messenger.sendErrorMessage(tooManyRequestErrorMessage, tabID)
289289
}
290290
}
291291
if (isAwsError(error)) {
292292
if (error.code === 'ThrottlingException') {
293293
// TODO: use the explicitly modeled exception reason for quota vs throttle{
294294
getLogger().error('Too many requests.')
295-
// TODO: move to constants file
296-
this.messenger.sendErrorMessage('Too many requests. Please wait before retrying.', tabID)
295+
this.messenger.sendErrorMessage(tooManyRequestErrorMessage, tabID)
297296
} else {
298297
// other service errors:
299298
// AccessDeniedException - should not happen because access is validated before this point in the client

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ export const noOpenProjectsFoundChatTestGenMessage = `Sorry, I couldn\'t find a
727727

728728
export const unitTestGenerationCancelMessage = 'Unit test generation cancelled.'
729729

730+
export const tooManyRequestErrorMessage = 'Too many requests. Please wait before retrying.'
731+
730732
export const noJavaProjectsFoundChatMessage = `I couldn\'t find a project that I can upgrade. Currently, I support Java 8, Java 11, and Java 17 projects built on Maven. Make sure your project is open in the IDE. For more information, see the [Amazon Q documentation](${codeTransformPrereqDoc}).`
731733

732734
export const linkToDocsHome = 'https://docs.aws.amazon.com/amazonq/latest/aws-builder-use-ug/code-transformation.html'

0 commit comments

Comments
 (0)