Open qsdgy opened 2 years ago
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()?
assert_eq!(tag.as_bytes(), match_tag.as_bytes());
Fatal(FatalError)
FatalErrorOccurred: bool
FatalErrorOccurred
run_command()
FatalError could be like this:
FatalError
enum FatalError{ TagBroken, Other, }
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 variantFatal(FatalError)
with some fatal error flag likeFatalErrorOccurred: bool
, and checkFatalErrorOccurred
flag before anyrun_command()
?FatalError
could be like this: