Skip to content

Commit 08a9170

Browse files
committed
show customer facing message
changelog logic
1 parent 8b02b85 commit 08a9170

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "/test: show customer facing error message"
4+
}

packages/core/src/codewhisperer/service/testGenHandler.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
CreateUploadUrlError,
1919
ExportResultsArchiveError,
2020
InvalidSourceZipError,
21+
TestGenFailedError,
2122
TestGenStoppedError,
2223
TestGenTimedOutError,
2324
} from '../../amazonqTest/error'
@@ -193,9 +194,10 @@ export async function pollTestJobStatus(
193194
}
194195
}
195196
ChatSessionManager.Instance.getSession().targetFileInfo = targetFileInfo
196-
if (resp.testGenerationJob?.status !== CodeWhispererConstants.TestGenerationJobStatus.IN_PROGRESS) {
197-
// This can be FAILED or COMPLETED
198-
status = resp.testGenerationJob?.status as CodeWhispererConstants.TestGenerationJobStatus
197+
status = resp.testGenerationJob?.status as CodeWhispererConstants.TestGenerationJobStatus
198+
if (status === CodeWhispererConstants.TestGenerationJobStatus.FAILED) {
199+
throw new TestGenFailedError(resp.testGenerationJob?.jobStatusReason)
200+
} else if (status === CodeWhispererConstants.TestGenerationJobStatus.COMPLETED) {
199201
logger.verbose(`testgen job status: ${status}`)
200202
logger.verbose(`Complete polling test job status.`)
201203
break

0 commit comments

Comments
 (0)