pub struct OssError {
pub kind: OssErrorKind,
pub context: Box<ErrorContext>,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Expand description
The unified error type for all OSS SDK operations.
Wraps an OssErrorKind together with context information and an
optional chained source error. All fallible SDK methods return this
type inside a Result.
§Examples
use aliyun_oss::error::{OssError, OssErrorKind, OssServiceError};
let err = OssError {
kind: OssErrorKind::ServiceError(Box::new(OssServiceError {
status_code: 404,
code: "NoSuchBucket".into(),
message: "The bucket does not exist.".into(),
request_id: "req-123".into(),
host_id: "oss-cn-hangzhou.aliyuncs.com".into(),
resource: None,
string_to_sign: None,
})),
context: Box::new(Default::default()),
source: None,
};Fields§
§kind: OssErrorKind§context: Box<ErrorContext>§source: Option<Box<dyn Error + Send + Sync>>Implementations§
Trait Implementations§
Source§impl Error for OssError
impl Error for OssError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for OssError
impl !RefUnwindSafe for OssError
impl Send for OssError
impl Sync for OssError
impl Unpin for OssError
impl UnsafeUnpin for OssError
impl !UnwindSafe for OssError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more