mountpoint_s3_client/error_metadata.rs
1/// Additional data fetched from S3 response, which caused an error
2#[derive(Default, Debug, Clone, PartialEq)]
3pub struct ClientErrorMetadata {
4 /// http code of the response, e.g. 403
5 pub http_code: Option<i32>,
6 /// error code from the response xml body, e.g. "AccessDenied"
7 pub error_code: Option<String>,
8 /// error message from the response xml body, e.g. "Access Denied"
9 pub error_message: Option<String>,
10}
11
12/// Allows using metadata of errors in generic implementations without knowing the exact type of an error,
13/// which as of today may be s3_crt_client::S3RequestError / mock_client::MockClientError / GetObjectError and etc.
14pub trait ProvideErrorMetadata {
15 fn meta(&self) -> ClientErrorMetadata;
16}