Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the flow when abnormal conditions occur in message handlers #15

Open
pedro-w opened this issue Sep 12, 2022 · 1 comment
Open

Comments

@pedro-w
Copy link
Collaborator

pedro-w commented Sep 12, 2022

Just a comment for later: I think our code will be easier to follow if we make invoke-message-handler handle two special kinds of errors, "error" and "aborted"?, which send the error's error message with show-error and show-info respectively. Then we can get rid of all the if/else nesting and use early return style:

if (problem-one)
  signal-lsp-error("i had problem one";
end;
...
if (problem-two)
  signal-lsp-info("i had problem two");
end;
... all good; handle the message...

Originally posted by @cgay in #14 (comment)

@pedro-w
Copy link
Collaborator Author

pedro-w commented Sep 12, 2022

Just put this here so we don't forget

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

No branches or pull requests

1 participant