aboutsummaryrefslogtreecommitdiff
path: root/karyons_core/src/error.rs
diff options
context:
space:
mode:
authorhozan23 <hozan23@proton.me>2023-11-09 11:38:19 +0300
committerhozan23 <hozan23@proton.me>2023-11-09 11:38:19 +0300
commit849d827486c75b2ab223d7b0e638dbb5b74d4d1d (patch)
tree41cd3babc37147ec4a40cab8ce8ae31c91cce33b /karyons_core/src/error.rs
parentde1354525895ffbad18f90a5246fd65157f7449e (diff)
rename crates
Diffstat (limited to 'karyons_core/src/error.rs')
-rw-r--r--karyons_core/src/error.rs51
1 files changed, 0 insertions, 51 deletions
diff --git a/karyons_core/src/error.rs b/karyons_core/src/error.rs
deleted file mode 100644
index 15947c8..0000000
--- a/karyons_core/src/error.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-use thiserror::Error as ThisError;
-
-pub type Result<T> = std::result::Result<T, Error>;
-
-#[derive(ThisError, Debug)]
-pub enum Error {
- #[error("IO Error: {0}")]
- IO(#[from] std::io::Error),
-
- #[error("Timeout Error")]
- Timeout,
-
- #[error("Path Not Found Error: {0}")]
- PathNotFound(&'static str),
-
- #[error("Channel Send Error: {0}")]
- ChannelSend(String),
-
- #[error("Channel Receive Error: {0}")]
- ChannelRecv(String),
-
- #[error("Decode Error: {0}")]
- Decode(String),
-
- #[error("Encode Error: {0}")]
- Encode(String),
-}
-
-impl<T> From<smol::channel::SendError<T>> for Error {
- fn from(error: smol::channel::SendError<T>) -> Self {
- Error::ChannelSend(error.to_string())
- }
-}
-
-impl From<smol::channel::RecvError> for Error {
- fn from(error: smol::channel::RecvError) -> Self {
- Error::ChannelRecv(error.to_string())
- }
-}
-
-impl From<bincode::error::DecodeError> for Error {
- fn from(error: bincode::error::DecodeError) -> Self {
- Error::Decode(error.to_string())
- }
-}
-
-impl From<bincode::error::EncodeError> for Error {
- fn from(error: bincode::error::EncodeError) -> Self {
- Error::Encode(error.to_string())
- }
-}