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

Make imap panic free #230

Open
qsdgy opened this issue Jul 3, 2022 · 0 comments
Open

Make imap panic free #230

qsdgy opened this issue Jul 3, 2022 · 0 comments

Comments

@qsdgy
Copy link

qsdgy commented Jul 3, 2022

There's a lot of pain in dealing with panic from lib, especially working with background services.

At least I'd like to remove panics came across with tag asserts (#229 #211).

How about turn assert_eq!(tag.as_bytes(), match_tag.as_bytes()); to a new imap::error::Error variant Fatal(FatalError) with some fatal error flag like FatalErrorOccurred: bool, and check FatalErrorOccurred flag before any run_command()?

FatalError could be like this:

enum FatalError{
    TagBroken,
    Other,
}
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