Skip to content

Commit

Permalink
Minor change in UploadTestArtifactToS3Error error message
Browse files Browse the repository at this point in the history
  • Loading branch information
laileni-aws committed Dec 11, 2024
1 parent 0cf0945 commit cea2049
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/core/src/codewhisperer/service/securityScanHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,14 @@ export async function uploadArtifactToS3(
`Amazon Q is unable to upload workspace artifacts to Amazon S3 for ${featureType}. ` +
'For more information, see the Amazon Q documentation or contact your network or organization administrator.'
)
const messageWithOutId = getTelemetryReasonDesc(error)?.includes('"PUT" request failed with code "403"')
errorMessage = messageWithOutId
? '"PUT" request failed with code "403"'
: (getTelemetryReasonDesc(error) ?? defaultMessage)
const errorDesc = getTelemetryReasonDesc(error)
if (errorDesc?.includes('"PUT" request failed with code "403"')) {
errorMessage = '"PUT" request failed with code "403"'
} else if (errorDesc?.includes('"PUT" request failed with code "503"')) {
errorMessage = '"PUT" request failed with code "503"'
} else {
errorMessage = errorDesc ?? defaultMessage
}
throw isCodeScan ? new UploadArtifactToS3Error(errorMessage) : new UploadTestArtifactToS3Error(errorMessage)
}
}
Expand Down

0 comments on commit cea2049

Please sign in to comment.