Skip to content

Commit 79d1e63

Browse files
committed
Safe
1 parent 6f0842d commit 79d1e63

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevControllerExtensions.kt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private fun FeatureDevController.openChatNotificationAction() =
289289
toolWindow?.show()
290290
}
291291

292-
// Should include error messages only for whitelisted exceptions
292+
// Should include error messages only for safe exceptions
293293
// i.e. exceptions with deterministic error messages and do not include sensitive data
294294
private fun getStackTraceForError(error: Throwable): String {
295295
val writer = StringWriter()
@@ -303,11 +303,20 @@ private fun getStackTraceForError(error: Throwable): String {
303303
seenExceptions.add(throwable)
304304

305305
when (throwable) {
306-
is NoChangeRequiredException, is EmptyPatchException, is ContentLengthException, is ZipFileCorruptedException,
307-
is UploadURLExpired, is CodeIterationLimitException, is GuardrailsException,
308-
is PromptRefusalException, is ThrottlingException, is ExportParseException,
309-
is CodeGenerationException, is UploadCodeException,
310-
is ConversationIdNotFoundException, is RepoSizeLimitError,
306+
is NoChangeRequiredException,
307+
is EmptyPatchException,
308+
is ContentLengthException,
309+
is ZipFileCorruptedException,
310+
is UploadURLExpired,
311+
is CodeIterationLimitException,
312+
is GuardrailsException,
313+
is PromptRefusalException,
314+
is ThrottlingException,
315+
is ExportParseException,
316+
is CodeGenerationException,
317+
is UploadCodeException,
318+
is ConversationIdNotFoundException,
319+
is RepoSizeLimitError,
311320
-> {
312321
printer.println("$prefix${throwable.javaClass.name}: ${throwable.message}")
313322
}

plugins/amazonq/chat/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevControllerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ class FeatureDevControllerTest : FeatureDevTestBase() {
696696
mockInOrder.verify(mockSession).sendMetricDataTelemetry(
697697
eq(MetricDataOperationName.EndCodeGeneration),
698698
eq(expectedResult),
699-
argThat { this.startsWith("stack trace: ") ?: false }
699+
argThat { this.startsWith("stack trace: " + error::class.qualifiedName) }
700700
)
701701
}
702702
}

0 commit comments

Comments
 (0)