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

Consolidate and Minimize Errors #51

Open
jasoncolburne opened this issue Jan 31, 2023 · 3 comments
Open

Consolidate and Minimize Errors #51

jasoncolburne opened this issue Jan 31, 2023 · 3 comments
Milestone

Comments

@jasoncolburne
Copy link
Collaborator

Our errors are getting out of hand and we need to do something to reduce the number of variants. Many can be grouped and details specified at runtime. As an example, we could turn this:

    #[error("unexpected code error: {0}")]
    UnexpectedCode(String),
    #[error("unexpected count code error: {0}")]
    UnexpectedCountCode(String),
    #[error("unexpected op code error: {0}")]
    UnexpectedOpCode(String),

into

    #[error("unexpected code error: {0}")]
    UnexpectedCode(String),

And simply specify the op and count information in the supplied string.

@jasoncolburne
Copy link
Collaborator Author

We should note that this will make consuming code slightly harder to write, since the information becomes encoded rather than explictly cased.

@m00sey m00sey added this to the v1.0.0 milestone Jan 31, 2023
@m00sey
Copy link
Member

m00sey commented Feb 9, 2023

address err!(Error::NonZeroedLeadByte()) et al as well

@m00sey m00sey mentioned this issue Feb 9, 2023
@kentbull
Copy link
Contributor

Meeting comment 03-30-23

We should clean this up before 1.0.0. It will take sitting down and designing an error set.

Usually in a library all the errors are wrapped to make a consistent interface. Do we want to do that or return the underlying errors from dependencies?

We will likely get to this when we are forced to by consuming it from other libraries.

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

3 participants