Skip to content

Commit 5e3c12c

Browse files
Merge master into feature/amazonqLSP
2 parents 7c1ddf7 + c9b4746 commit 5e3c12c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "feat(amazonq): Add error message for updated README too large"
4+
}

packages/core/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
"AWS.amazonq.doc.error.noFolderSelected": "It looks like you didn't choose a folder. Choose a folder to continue.",
380380
"AWS.amazonq.doc.error.contentLengthError": "Your workspace is too large for me to review. Your workspace must be within the quota, even if you choose a smaller folder. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
381381
"AWS.amazonq.doc.error.readmeTooLarge": "The README in your folder is too large for me to review. Try reducing the size of your README, or choose a folder with a smaller README. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
382+
"AWS.amazonq.doc.error.readmeUpdateTooLarge": "The updated README is too large. Try reducing the size of your README, or asking for a smaller update. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
382383
"AWS.amazonq.doc.error.workspaceEmpty": "The folder you chose did not contain any source files in a supported language. Choose another folder and try again. For more information on supported languages, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",
383384
"AWS.amazonq.doc.error.promptTooVague": "I need more information to make changes to your README. Try providing some of the following details:\n- Which sections you want to modify\n- The content you want to add or remove\n- Specific issues that need correcting\n\nFor more information on prompt best practices, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",
384385
"AWS.amazonq.doc.error.promptUnrelated": "These changes don't seem related to documentation. Try describing your changes again, using the following best practices:\n- Changes should relate to how project functionality is reflected in the README\n- Content you refer to should be available in your codebase\n\n For more information on prompt best practices, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",

packages/core/src/amazonqDoc/errors.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ export class ReadmeTooLargeError extends ToolkitError {
2020
}
2121
}
2222

23+
export class ReadmeUpdateTooLargeError extends ToolkitError {
24+
constructor() {
25+
super(i18n('AWS.amazonq.doc.error.readmeUpdateTooLarge'), {
26+
code: ReadmeUpdateTooLargeError.name,
27+
})
28+
}
29+
}
30+
2331
export class WorkspaceEmptyError extends ToolkitError {
2432
constructor() {
2533
super(i18n('AWS.amazonq.doc.error.workspaceEmpty'), {

packages/core/src/amazonqDoc/session/sessionState.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545
PromptTooVagueError,
4646
PromptUnrelatedError,
4747
ReadmeTooLargeError,
48+
ReadmeUpdateTooLargeError,
4849
WorkspaceEmptyError,
4950
} from '../errors'
5051
import { DocMessenger } from '../messenger'
@@ -149,6 +150,9 @@ abstract class CodeGenBase {
149150
case codegenResult.codeGenerationStatusDetail?.includes('README_TOO_LARGE'): {
150151
throw new ReadmeTooLargeError()
151152
}
153+
case codegenResult.codeGenerationStatusDetail?.includes('README_UPDATE_TOO_LARGE'): {
154+
throw new ReadmeUpdateTooLargeError()
155+
}
152156
case codegenResult.codeGenerationStatusDetail?.includes('WORKSPACE_TOO_LARGE'): {
153157
throw new ContentLengthError()
154158
}

0 commit comments

Comments
 (0)