Skip to content

Commit

Permalink
Bubble up underlying QOS IO error / OS IO error
Browse files Browse the repository at this point in the history
  • Loading branch information
r-n-o committed Jun 17, 2024
1 parent 7e0e367 commit aa74a74
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/qos_net/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use hickory_resolver::error::ResolveError;
#[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)]
pub enum QosNetError {
/// Error variant encapsulating OS IO errors
IOError,
IOError(String),
/// Error variant encapsulating OS IO errors
QOSIOError,
QOSIOError(String),
/// The message is too large.
OversizeMsg,
/// Payload is too big. See `MAX_ENCODED_MSG_LEN` for the upper bound on
Expand Down Expand Up @@ -41,14 +41,16 @@ pub enum QosNetError {
}

impl From<std::io::Error> for QosNetError {
fn from(_err: std::io::Error) -> Self {
Self::IOError
fn from(err: std::io::Error) -> Self {
let msg = format!("{err:?}");
Self::IOError(msg)
}
}

impl From<qos_core::io::IOError> for QosNetError {
fn from(_err: qos_core::io::IOError) -> Self {
Self::QOSIOError
fn from(err: qos_core::io::IOError) -> Self {
let msg = format!("{err:?}");
Self::QOSIOError(msg)
}
}

Expand Down

0 comments on commit aa74a74

Please sign in to comment.