Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/rados_striper.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#[cfg(feature = "rados_striper")]
use {
ceph::ceph as ceph_helpers, ceph::error::RadosError, nix::errno::Errno, std::env, std::str,
ceph::ceph as ceph_helpers,
ceph::error::{Errno, RadosError},
std::env,
std::str,
std::sync::Arc,
};

Expand Down
6 changes: 4 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ use uuid::Error as UuidError;

extern crate nix;

pub use nix::errno::Errno;

/// Custom error handling for the library
#[derive(Debug)]
pub enum RadosError {
FromUtf8Error(FromUtf8Error),
NulError(NulError),
Error(String),
IoError(Error),
ApiError(nix::errno::Errno),
ApiError(Errno),
IntoStringError(IntoStringError),
ParseIntError(ParseIntError),
ParseBoolError(ParseBoolError),
Expand Down Expand Up @@ -139,6 +141,6 @@ impl From<Error> for RadosError {
}
impl From<i32> for RadosError {
fn from(err: i32) -> RadosError {
RadosError::ApiError(nix::errno::Errno::from_raw(-err))
RadosError::ApiError(Errno::from_raw(-err))
}
}