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

Simplify some error handling and make it more structured #1946

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

MaxVerevkin
Copy link
Collaborator

  • Remove kind and block fields from Error.
  • Removed block field is replaced by BlockError struct.
  • Represent formatting errors (such as "placeholder not found") as an enum with thiserror macro.
  • Merge ResultExt and OptionExt into ErrorContext.

@MaxVerevkin MaxVerevkin added the cleanup Code refactoring and such label Sep 20, 2023
@MaxVerevkin
Copy link
Collaborator Author

Notable things that where broken and still are:

  • Invalid block-specific configuration does not bring down the entire bar. But errors in the "common" config options (such as merge_with_next = 1 do). This is inconsistent. It might be okay to fail completely in both cases.
  • Invalid click-handler button (such as button = "not a valid button") does not result in any sort of error.

@bim9262
Copy link
Collaborator

bim9262 commented Sep 27, 2023

I think these changes look good. Let's create new issues for the things that you mentioned that are still broken (assuming there aren't already issues open)

@MaxVerevkin MaxVerevkin merged commit 8280cc3 into master Oct 5, 2023
22 checks passed
@MaxVerevkin MaxVerevkin deleted the errors branch October 5, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code refactoring and such
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants