[BUG] Handle language server is closed error in user readable format #500
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
priority/backlog
Higher priority than priority/awaiting-more-evidence.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Is there an existing issue for this?
Konveyor version
All
Priority
Minor
Current Behavior
When we get an error from a language server, we usually get it from an RPC connection either stopping or being unreachable. The current errors that come out of the package are like:
ERRO[0015] unable to ask for tackle rule entry error="write |1: broken pipe" provider=java
Expected Behavior
We should expose errors that make sense to the end user and log the errors coming from RPC at a lower verbosity for debugging.
The error that is exposed should be "connection to the language server is closed, language server is not running"
How Reproducible
Always (Default)
Steps To Reproduce
The pod is killed, and you will eventually see: ERRO[0015] unable to ask for tackle rule entry error="write |1: broken pipe" provider=java
Environment
Anything else?
To fix this, we will need to capture this error from the RPC client and override it.
First find all the times we call
rpc.Call
function. Create a new package injsonrpc2
calledrpcerr
.From here create a function that will look like:
This function will compare the error string, for the error that we don't want to see. If it finds it return true, if not return false.
Where we deal with the rpc.Call error, add a block that will see if it is a closed error, if it is, change the error in the log to:
``fmt.Errrof("connection to the language server is closed, lanaguage server is not running")```
The text was updated successfully, but these errors were encountered: