wip: move out of dioxus main
This commit is contained in:
commit
aebf6678a8
14 files changed
+696
No files matched your search
@@ -0,0 +1,34 @@
|
||||
use thiserror::Error as ThisError;
|
||||
|
||||
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
||||
|
||||
#[derive(ThisError, Debug)]
|
||||
pub enum Error {
|
||||
/// Used when errors need to propogate but are too unique to be typed
|
||||
#[error("{0}")]
|
||||
Unique(String),
|
||||
|
||||
#[error("I/O Error: {0}")]
|
||||
IO(#[from] std::io::Error),
|
||||
|
||||
#[error("Failed to write error")]
|
||||
FailedToWrite,
|
||||
|
||||
#[error("Failed to write error")]
|
||||
CargoError(String),
|
||||
|
||||
#[error(transparent)]
|
||||
Other(#[from] anyhow::Error),
|
||||
}
|
||||
|
||||
impl From<&str> for Error {
|
||||
fn from(s: &str) -> Self {
|
||||
Error::Unique(s.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for Error {
|
||||
fn from(s: String) -> Self {
|
||||
Error::Unique(s)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user