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

Proivde a way for users to give span & help messages #90

Open
nicopap opened this issue Sep 5, 2023 · 0 comments
Open

Proivde a way for users to give span & help messages #90

nicopap opened this issue Sep 5, 2023 · 0 comments
Labels
C-chirp relates to the cuicui_chirp file format crate specifically T-enhancement New feature or request T-error handling Has to do with how we handle errors

Comments

@nicopap
Copy link
Owner

nicopap commented Sep 5, 2023

Export a

#[derive(Error, Debug)]
struct NiceError {
  help: Option<Box<str>>,
  span_offset: Option<u32>,
  source: anyhow::Error,
}

Now the user can return such an error from their custom argument parser impls, and we can check in the interpreter for them using downcasting, and use their inner offset/help messages in the full message.

@nicopap nicopap added T-enhancement New feature or request T-error handling Has to do with how we handle errors C-chirp relates to the cuicui_chirp file format crate specifically labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-chirp relates to the cuicui_chirp file format crate specifically T-enhancement New feature or request T-error handling Has to do with how we handle errors
Projects
None yet
Development

No branches or pull requests

1 participant