Atiyah:
InvalidStateException
It is up to you when to throw it, one should match the words in the exception to the kind of error. The arguments are again, situation dependent and are most likely literals.
Here’s an example from the wild
opened 12:50AM - 18 Dec 21 UTC
bug
non-vscode
I've just tried to run LanguageServer and encountered the following error:
``… `julia
julia> using LanguageServer
julia> using LanguageServer.SymbolServer
julia> runserver()
ERROR: MethodError: no method matching (::LanguageServer.var"#93#95"{LanguageServerInstance})(::String, ::Int64)
Closest candidates are:
(::LanguageServer.var"#93#95")(::Any) at ~/.julia/packages/LanguageServer/JrIEf/src/languageserverinstance.jl:185
Stacktrace:
[1] getstore(ssi::SymbolServerInstance, environment_path::String, progress_callback::LanguageServer.var"#93#95"{LanguageServerInstance}, error_handler::Nothing; download::Bool)
@ SymbolServer ~/.julia/packages/SymbolServer/GBhfx/src/SymbolServer.jl:47
[2] macro expansion
@ ~/.julia/packages/LanguageServer/JrIEf/src/languageserverinstance.jl:182 [inlined]
[3] (::LanguageServer.var"#92#94"{LanguageServerInstance})()
@ LanguageServer ./task.jl:423
```
I'm on Julia 1.7 with LanguageServer 4.1.0. I've already ried to remove compiled/ and packages/ folders from ~/.julia/ but didn't help. Any ideas what's causing this?
Which if we trace back to where it is thrown
and here’s the documentation for that call
https://docs.julialang.org/en/v1/base/parallel/#Base.take!-Tuple{Channel}
What seems to be different in Julia is the docs don’t mention that take! might throw and we have no way of annotating that. Meaning one day you might log in to find you didn’t use try
in your long running code and you can make a sad face.
2 Likes