fix: RPC error message

This commit is contained in:
Wojciech Nawrocki 2022-04-10 20:43:55 -04:00 committed by Leonardo de Moura
parent 367b0fc80f
commit d649fc9159

View file

@ -41,10 +41,13 @@ private unsafe def handleRpcCallUnsafe (p : Lsp.RpcCallParams) : RequestM (Reque
let proc : Except _ _ := Lean.Environment.evalConstCheck RpcProcedure snap.env options ``RpcProcedure procName
match proc with
| Except.ok x => x.wrapper p.sessionId p.params
| Except.error e => throwThe RequestError { code := JsonRpc.ErrorCode.methodNotFound, message := "asdf" }
| Except.error e => throwThe RequestError {
code := JsonRpc.ErrorCode.internalError
message := s!"Failed to evaluate RPC constant '{procName}': {e}" }
else
throwThe RequestError { code := JsonRpc.ErrorCode.methodNotFound
message := s!"No RPC method '{p.method}' bound" }
throwThe RequestError {
code := JsonRpc.ErrorCode.methodNotFound
message := s!"No RPC method '{p.method}' bound" }
@[implementedBy handleRpcCallUnsafe]
private constant handleRpcCall (p : Lsp.RpcCallParams) : RequestM (RequestTask Json)