Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amazonq): include exception context when logging encoder failure #5364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
try {
return projectContextProvider.query(prompt, timeout)
} catch (e: Exception) {
logger.warn { "error while querying for project context $e.message" }
logger.warn(e) { "error while querying for project context" }

Check warning on line 58 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextController.kt

View check run for this annotation

Codecov / codecov/patch

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

Added line #L58 was not covered by tests
return emptyList()
}
}
Expand All @@ -64,11 +64,11 @@
try {
projectContextProvider.queryInline(query, filePath, InlineContextTarget.CODEMAP)
} catch (e: Exception) {
var logStr = "error while querying inline for project context $e.message"
if (e is TimeoutCancellationException || e is TimeoutException) {
logStr = "project context times out with 50ms ${e.message}"
logger.warn { "project context times out with 50ms" }

Check warning on line 68 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextController.kt

View check run for this annotation

Codecov / codecov/patch

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

Added line #L68 was not covered by tests
} else {
logger.warn(e) { "error while querying inline for project context" }

Check warning on line 70 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextController.kt

View check run for this annotation

Codecov / codecov/patch

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

Added line #L70 was not covered by tests
}
logger.warn { logStr }
emptyList()
}

Expand All @@ -77,7 +77,7 @@
try {
return projectContextProvider.updateIndex(filePaths, mode)
} catch (e: Exception) {
logger.warn { "error while updating index for project context $e.message" }
logger.warn(e) { "error while updating index for project context" }

Check warning on line 80 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/ProjectContextController.kt

View check run for this annotation

Codecov / codecov/patch

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

Added line #L80 was not covered by tests
}
}

Expand Down
Loading