Skip to content

Commit f200c7c

Browse files
committed
Addressing Comments
1 parent 1c89a6e commit f200c7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import kotlinx.coroutines.CoroutineScope
1616
import kotlinx.coroutines.Job
1717
import kotlinx.coroutines.delay
1818
import kotlinx.coroutines.launch
19+
import software.amazon.awssdk.core.exception.SdkServiceException
1920
import software.amazon.awssdk.services.codewhispererruntime.model.GetTestGenerationResponse
2021
import software.amazon.awssdk.services.codewhispererruntime.model.Range
2122
import software.amazon.awssdk.services.codewhispererruntime.model.StartTestGenerationResponse
2223
import software.amazon.awssdk.services.codewhispererruntime.model.TargetCode
2324
import software.amazon.awssdk.services.codewhispererruntime.model.TestGenerationJobStatus
24-
import software.amazon.awssdk.services.codewhispererruntime.model.ThrottlingException
2525
import software.amazon.awssdk.services.codewhispererstreaming.model.ExportContext
2626
import software.amazon.awssdk.services.codewhispererstreaming.model.ExportIntent
2727
import software.aws.toolkits.core.utils.debug
@@ -129,8 +129,8 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
129129
)
130130
} catch (e: Exception) {
131131
val statusCode = when {
132-
e is ThrottlingException -> e.statusCode()
133-
else -> 500
132+
e is SdkServiceException -> e.statusCode()
133+
else -> 400
134134
}
135135
LOG.error(e) { "Unexpected error while creating test generation job" }
136136
val errorMessage = getTelemetryErrorMessage(e, CodeWhispererConstants.FeatureName.TEST_GENERATION)

0 commit comments

Comments
 (0)