mountpoint_s3_fs/fs/error_metadata.rs
1use mountpoint_s3_client::error_metadata::ClientErrorMetadata;
2
3/// Additional data about an error to be reported in the event log when operation fails.
4/// This includes info fetched from S3 response and info provided with the request.
5#[derive(Default, Debug, Clone, PartialEq)]
6pub struct ErrorMetadata {
7 /// Additional data fetched from S3 response, which caused an error
8 pub client_error_meta: ClientErrorMetadata,
9 /// A code identifying the error, assigned in mountpoint-s3 crate, e.g. "error.client"
10 pub error_code: Option<String>,
11 /// Bucket with which the fuse operation was associated
12 pub s3_bucket_name: Option<String>,
13 /// Key with which the fuse operation was associated
14 pub s3_object_key: Option<String>,
15}
16
17/// A code identifying the error reported to the event log. As of today, users who deploy Mountpoint as an infrastructural component
18/// are interested in errors which *may be fixed by users of this infrastructure* (e.g. a forbidden error). Next, it is vital
19/// to be able to distinguish fuse operation errors which *may be tolerated by a workload* (e.g. a non-existent object). Other errors
20/// may be reported as "error.internal" with further investigation involving debug log access.
21///
22/// NOTE: the event log API is not stable and is subject to breaking changes
23pub const MOUNTPOINT_ERROR_CLIENT: &str = "error.client";
24pub const MOUNTPOINT_ERROR_LOOKUP_NONEXISTENT: &str = "error.fs.lookup_nonexistent";
25pub const MOUNTPOINT_ERROR_INTERNAL: &str = "error.internal";
26pub const MOUNTPOINT_EVENT_READY: &str = "event.ready";