Skip to content

fix(amazonq): properly handle encode server exception #5585

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

Closed
wants to merge 2 commits into from
Closed
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 @@ -123,11 +123,16 @@ class ProjectContextProvider(val project: Project, private val encoderServer: En
}
retryCount.incrementAndGet()
} catch (e: Exception) {
logger.warn(e) { "failed to init project context" }
if (e.stackTraceToString().contains("Connection refused")) {
retryCount.incrementAndGet()
delay(10000)
if (encoderServer.isNodeProcessRunning()) {
return
} else {
logger.warn(e) { "project context process quit unexpectedly" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the process is died, restarting this function does not help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process quit unexpectly issue will be fixed in newer WS LSP releases, this PR is no longer needed

retryCount.incrementAndGet()
delay(10000)
}
} else {
logger.warn(e) { "failed to init project context" }
return
}
}
Expand Down
Loading