Skip to content

Commit 30dd7ad

Browse files
committed
show customer facing message
changelog logic
1 parent 8b02b85 commit 30dd7ad

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-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: 8 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'
@@ -196,9 +197,13 @@ export async function pollTestJobStatus(
196197
if (resp.testGenerationJob?.status !== CodeWhispererConstants.TestGenerationJobStatus.IN_PROGRESS) {
197198
// This can be FAILED or COMPLETED
198199
status = resp.testGenerationJob?.status as CodeWhispererConstants.TestGenerationJobStatus
199-
logger.verbose(`testgen job status: ${status}`)
200-
logger.verbose(`Complete polling test job status.`)
201-
break
200+
if (status === CodeWhispererConstants.TestGenerationJobStatus.FAILED) {
201+
throw new TestGenFailedError(resp.testGenerationJob?.jobStatusReason)
202+
} else {
203+
logger.verbose(`testgen job status: ${status}`)
204+
logger.verbose(`Complete polling test job status.`)
205+
break
206+
}
202207
}
203208
throwIfCancelled()
204209
await sleep(CodeWhispererConstants.testGenJobPollingIntervalMilliseconds)

0 commit comments

Comments
 (0)