todo:Error

This commit is contained in:
weisd
2024-07-02 16:03:26 +08:00
parent e013d33691
commit ace3fbdfa0
5 changed files with 113 additions and 170 deletions
+10 -11
View File
@@ -1,17 +1,18 @@
// use s3s::S3Error;
// use s3s::S3ErrorCode;
use s3s::S3Error;
use s3s::S3ErrorCode;
use s3s::StdError;
use std::panic::Location;
use tracing::error;
pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
#[derive(Debug)]
pub struct Error {
source: StdError,
}
pub type Result<T = (), E = Error> = std::result::Result<T, E>;
impl Error {
#[must_use]
#[track_caller]
@@ -37,11 +38,11 @@ where
}
}
// impl From<Error> for S3Error {
// fn from(e: Error) -> Self {
// S3Error::with_source(S3ErrorCode::InternalError, e.source)
// }
// }
impl From<Error> for S3Error {
fn from(e: Error) -> Self {
S3Error::with_source(S3ErrorCode::InternalError, e.source)
}
}
#[inline]
#[track_caller]
@@ -70,5 +71,3 @@ macro_rules! try_ {
}
};
}