-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: add an error code for SessionClosedError #729
Conversation
PR missing one of the required labels: {'documentation', 'new feature', 'internal', 'enhancement', 'dependencies', 'bug', 'breaking-change'} |
src/result.rs
Outdated
@@ -25,6 +25,7 @@ pub const Z_ENETWORK: z_result_t = -4; | |||
pub const Z_ENULL: z_result_t = -5; | |||
pub const Z_EUNAVAILABLE: z_result_t = -6; | |||
pub const Z_EDESERIALIZE: z_result_t = -7; | |||
pub const Z_SESSION_CLOSED: z_result_t = -8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Z_ESESSION_CLOSED maybe, to make in the same style as all other errors ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/publisher.rs
Outdated
result::Z_OK | ||
match put.wait() { | ||
Ok(_) => result::Z_OK, | ||
Err(e) if e.downcast_ref::<SessionClosedError>().is_some() => result::Z_SESSION_CLOSED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need some specific tracing message here and in other places ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so, because it's kind of included in the error kind. So the user can choose to ignore it without cluttering the logs.
Resolves #727