FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow method handlers to return json rpc errors by smacke · Pull Request #20 · python-lsp/python-lsp-jsonrpc · GitHub

Allow method handlers to return json rpc errors - #20

Merged
ccordoba12 merged 3 commits into
python-lsp:developfrom
smacke:allow-error-response
Sep 7, 2023
Merged

Allow method handlers to return json rpc errors#20
ccordoba12 merged 3 commits into
python-lsp:developfrom
smacke:allow-error-response

Conversation

smacke commented Sep 6, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

In this PR, we allow method handlers to return results that could themselves contain "result" and "error" fields. If they contain neither field, the old behavior is maintained. If they contain one or both fields, however, we read those fields and use them in the json rpc response.

This will be useful for addressing python-lsp/python-lsp-server#314 -- rather than raising an exception when we get a request post-shutdown, we'll be able to instead call a method that returns a json rpc invalid request.

See also python-lsp/python-lsp-server#432

smacke commented Sep 7, 2023

Copy link
Copy Markdown
Contributor Author

@ccordoba12 I noticed a bug and it looks like CI caught it as well; pushed a fix and it should hopefully pass now if you kick it.

ccordoba12 added this to the v1.1.0 milestone Sep 7, 2023
ccordoba12 changed the title allow method handlers to return json rpc errors Allow method handlers to return json rpc errors Sep 7, 2023

ccordoba12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good to me, thanks for your help with this @smacke!

ccordoba12 merged commit b0331b7 into python-lsp:develop Sep 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL