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

refactor: Harper-ls Error-Handling Improvements #349

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

grantlemons
Copy link
Contributor

@grantlemons grantlemons commented Jan 2, 2025

This should make it easier to track issues in harper_ls. This changes appropriate to return anyhow::Results, and in functions that can't, the anyhow error is logged in a concise way. These functions also add context to the anyhow error to make it easier to trace.

Anyhow also ships with a macro bail!(), which simplifies forceable returns of new anyhow errors. For instance:

return Err(anyhow::format_err!("forceStable must be a boolean value."));

Becomes:

bail!("forceStable must be a boolean value.");

@grantlemons grantlemons marked this pull request as ready for review January 4, 2025 15:32
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.

1 participant