Skip to content

Commit 428ebde

Browse files
authored
fix(q): include exception context when logging encoder failure
Logs indicate failure but no further details
1 parent b440147 commit 428ebde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextController.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ProjectContextController(private val project: Project, private val cs: Cor
5555
try {
5656
return projectContextProvider.query(prompt, timeout)
5757
} catch (e: Exception) {
58-
logger.warn { "error while querying for project context $e.message" }
58+
logger.warn(e) { "error while querying for project context" }
5959
return emptyList()
6060
}
6161
}
@@ -64,11 +64,11 @@ class ProjectContextController(private val project: Project, private val cs: Cor
6464
try {
6565
projectContextProvider.queryInline(query, filePath, InlineContextTarget.CODEMAP)
6666
} catch (e: Exception) {
67-
var logStr = "error while querying inline for project context $e.message"
6867
if (e is TimeoutCancellationException || e is TimeoutException) {
69-
logStr = "project context times out with 50ms ${e.message}"
68+
logger.warn { "project context times out with 50ms" }
69+
} else {
70+
logger.warn(e) { "error while querying inline for project context" }
7071
}
71-
logger.warn { logStr }
7272
emptyList()
7373
}
7474

@@ -77,7 +77,7 @@ class ProjectContextController(private val project: Project, private val cs: Cor
7777
try {
7878
return projectContextProvider.updateIndex(filePaths, mode)
7979
} catch (e: Exception) {
80-
logger.warn { "error while updating index for project context $e.message" }
80+
logger.warn(e) { "error while updating index for project context" }
8181
}
8282
}
8383

0 commit comments

Comments
 (0)