@@ -243,6 +243,10 @@ export class TestController {
243
243
this . messenger . sendUpdatePromptProgress ( data . tabID , null )
244
244
const session = this . sessionStorage . getSession ( )
245
245
const isCancel = data . error . uiMessage === unitTestGenerationCancelMessage
246
+ let telemetryErrorMessage = getTelemetryReasonDesc ( data . error )
247
+ if ( session . stopIteration ) {
248
+ telemetryErrorMessage = getTelemetryReasonDesc ( data . error . uiMessage . replaceAll ( '```' , '' ) )
249
+ }
246
250
telemetry . amazonq_utgGenerateTests . emit ( {
247
251
cwsprChatProgrammingLanguage : session . fileLanguage ?? 'plaintext' ,
248
252
jobId : session . listOfTestGenerationJobId [ 0 ] , // For RIV, UTG does only one StartTestGeneration API call
@@ -255,7 +259,8 @@ export class TestController {
255
259
artifactsUploadDuration : session . artifactsUploadDuration ,
256
260
perfClientLatency : performance . now ( ) - session . testGenerationStartTime ,
257
261
result : isCancel ? 'Cancelled' : 'Failed' ,
258
- reasonDesc : getTelemetryReasonDesc ( data . error ) ,
262
+ reason : data . error . code ,
263
+ reasonDesc : telemetryErrorMessage ,
259
264
isSupportedLanguage : true ,
260
265
credentialStartUrl : AuthUtil . instance . startUrl ,
261
266
httpStatusCode : data . error . statusCode ?? 0 , // If status code is 0, need to investigate where this is originating from.
0 commit comments