Skip to content

Commit b59dc27

Browse files
committed
lint errors
1 parent 2271484 commit b59dc27

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 {
@@ -288,16 +289,14 @@ export class TestController {
288289
)
289290
} else {
290291
getLogger().error('Too many requests.')
291-
// TODO: move to constants file
292-
return this.messenger.sendErrorMessage('Too many requests. Please wait before retrying.', tabID)
292+
return this.messenger.sendErrorMessage(tooManyRequestErrorMessage, tabID)
293293
}
294294
}
295295
if (isAwsError(error)) {
296296
if (error.code === 'ThrottlingException') {
297297
// TODO: use the explicitly modeled exception reason for quota vs throttle{
298298
getLogger().error('Too many requests.')
299-
// TODO: move to constants file
300-
this.messenger.sendErrorMessage('Too many requests. Please wait before retrying.', tabID)
299+
this.messenger.sendErrorMessage(tooManyRequestErrorMessage, tabID)
301300
} else {
302301
// other service errors:
303302
// 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
@@ -723,6 +723,8 @@ export const noOpenProjectsFoundChatTestGenMessage = `Sorry, I couldn\'t find a
723723

724724
export const unitTestGenerationCancelMessage = 'Unit test generation cancelled.'
725725

726+
export const tooManyRequestErrorMessage = 'Too many requests. Please wait before retrying.'
727+
726728
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}).`
727729

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

0 commit comments

Comments
 (0)