Skip to content

Commit ab3b509

Browse files
authored
fix(amazonq): include more context on chat response error (#5900)
Sometimes the error body is not actually useful ``` An unexpected error occurred, check the logs for more information. ``` After: ``` McpManager not initialized—call McpManager.init(...) first: An unexpected error occurred, check the logs for more information. ```
1 parent a4a21c6 commit ab3b509

File tree

1 file changed

+1
-1
lines changed
  • plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat

1 file changed

+1
-1
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/ChatCommunicationManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class ChatCommunicationManager(private val project: Project, private val cs: Cor
200200
var errorMessage: String? = null
201201
if (exception is ResponseErrorException) {
202202
errorMessage = tryOrNull {
203-
Gson().fromJson(exception.responseError.data as JsonObject, ChatMessage::class.java).body
203+
"${exception.responseError.message}: ${Gson().fromJson(exception.responseError.data as JsonObject, ChatMessage::class.java).body}"
204204
} ?: exception.responseError.message
205205
}
206206

0 commit comments

Comments
 (0)