Skip to content

Commit

Permalink
chore: update error derivation crates
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Sep 26, 2024
1 parent 917d07e commit 653b34c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lazy_static = "1.4.0"
rand = "~0.8.5"
rand_chacha = "~0.3.1"
rayon = "1.5.1"
err-derive = "~0.3.1"
thiserror = "1.0"
num_cpus = "1.13.0"
itertools = "~0.10.0"
tempfile = "3.6.0"
Expand Down
32 changes: 16 additions & 16 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// permissions and limitations relating to use of the SAFE Network Software.

use bincode::ErrorKind;
use err_derive::Error;
use std::io::Error as IoError;
use thiserror::Error;

/// Specialisation of `std::Result` for crate.
pub type Result<T, E = Error> = std::result::Result<T, E>;
Expand All @@ -17,26 +17,26 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
#[allow(missing_docs)]
pub enum Error {
#[error(display = "An error during compression or decompression.")]
#[error("An error during compression or decompression.")]
Compression,
#[error(display = "An error during initializing CBC-AES cipher instance.")]
#[error("An error during initializing CBC-AES cipher instance.")]
Cipher(String),
#[error(display = "An error within the symmetric encryption process.")]
#[error("An error within the symmetric encryption process.")]
Encryption,
#[error(display = "An error within the symmetric decryption process({})", _0)]
#[error("An error within the symmetric decryption process({})", _0)]
Decryption(String),
#[error(display = "A generic I/O error")]
Io(#[source] IoError),
#[error(display = "Generic error({})", _0)]
#[error("A generic I/O error")]
Io(#[from] IoError),
#[error("Generic error({})", _0)]
Generic(String),
#[error(display = "Serialisation error")]
Bincode(#[source] Box<ErrorKind>),
#[error(display = "deserialization")]
#[error("Serialisation error")]
Bincode(#[from] Box<ErrorKind>),
#[error("deserialization")]
Deserialise,
#[error(display = "num parse error")]
NumParse(#[source] std::num::ParseIntError),
#[error(display = "Rng error")]
Rng(#[source] rand::Error),
#[error(display = "Unable to obtain lock")]
#[error("num parse error")]
NumParse(#[from] std::num::ParseIntError),
#[error("Rng error")]
Rng(#[from] rand::Error),
#[error("Unable to obtain lock")]
Poison,
}

0 comments on commit 653b34c

Please sign in to comment.