Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "feat(amazonq): Add error message for updated README too large"
}
1 change: 1 addition & 0 deletions packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@
"AWS.amazonq.doc.error.noFolderSelected": "It looks like you didn't choose a folder. Choose a folder to continue.",
"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>",
"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>",
"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>",
"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>",
"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>",
"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>",
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/amazonqDoc/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ export class ReadmeTooLargeError extends ToolkitError {
}
}

export class ReadmeUpdateTooLargeError extends ToolkitError {
constructor() {
super(i18n('AWS.amazonq.doc.error.readmeUpdateTooLarge'), {
code: ReadmeUpdateTooLargeError.name,
})
}
}

export class WorkspaceEmptyError extends ToolkitError {
constructor() {
super(i18n('AWS.amazonq.doc.error.workspaceEmpty'), {
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/amazonqDoc/session/sessionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
PromptTooVagueError,
PromptUnrelatedError,
ReadmeTooLargeError,
ReadmeUpdateTooLargeError,
WorkspaceEmptyError,
} from '../errors'
import { DocMessenger } from '../messenger'
Expand Down Expand Up @@ -149,6 +150,9 @@ abstract class CodeGenBase {
case codegenResult.codeGenerationStatusDetail?.includes('README_TOO_LARGE'): {
throw new ReadmeTooLargeError()
}
case codegenResult.codeGenerationStatusDetail?.includes('README_UPDATE_TOO_LARGE'): {
throw new ReadmeUpdateTooLargeError()
}
case codegenResult.codeGenerationStatusDetail?.includes('WORKSPACE_TOO_LARGE'): {
throw new ContentLengthError()
}
Expand Down
Loading