Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

sendRequest chokes on ResponseError #73

Closed
pepeiborra opened this issue Sep 5, 2020 · 0 comments · Fixed by #74
Closed

sendRequest chokes on ResponseError #73

pepeiborra opened this issue Sep 5, 2020 · 0 comments · Fixed by #74
Labels
bug Something isn't working

Comments

@pepeiborra
Copy link
Contributor

Test code:

    -- Send a dummy message to provoke a response from the server.
    -- This guarantees that we have at least one message to
    -- process, so message won't block or timeout.
    void $ sendRequest (CustomClientMethod "non-existent-method") ()

Server code:

        = return $ Left 
        $ ResponseError InvalidRequest ("Cannot parse request") Nothing

Result:

--> {
    "jsonrpc": "2.0",
    "params": [],
    "method": "non-existent-method",
    "id": 3
}
ghcide-tests: CustomClientMethod "non-existent-method" is not a request: "{\"error\":{\"code\":-32600,\"message\":\"Cannot parse request\"},\"jsonrpc\":\"2.0\",\"id\":3}"
CallStack (from HasCallStack):
  error, called at src/Language/Haskell/LSP/Test/Decoding.hs:119:36 in lsp-tst-0.11.0.4-34b84e01:Language.Haskell.LSP.Test.Decoding

https://github.com/bubba/lsp-test/blob/23b1dcf20f37869d29158ebc38402503894bcd80/src/Language/Haskell/LSP/Test/Decoding.hs#L95-L120

@lukel97 lukel97 added the bug Something isn't working label Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants