scientific_workflow/execution/error.rs
1use std::path::PathBuf;
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6#[non_exhaustive]
7pub enum ExecutionScopeError {
8 /// A caller-supplied scope name was empty or not one safe path component.
9 #[error("invalid execution scope name `{name}`")]
10 InvalidName {
11 /// Rejected scope name.
12 name: String,
13 },
14 /// The host UTC clock could not be formatted for the scope identity.
15 #[error("failed to format execution scope creation timestamp")]
16 Timestamp {
17 /// Timestamp-formatting failure.
18 #[source]
19 source: time::error::Format,
20 },
21 /// A filesystem operation failed at a scope boundary.
22 #[error("failed to {operation} execution scope at `{path}`")]
23 Io {
24 /// Stable filesystem action.
25 operation: &'static str,
26 /// Affected root or scope path.
27 path: PathBuf,
28 /// Underlying operating-system failure.
29 #[source]
30 source: std::io::Error,
31 },
32 /// Generated identity attempts repeatedly collided with existing scopes.
33 #[error("could not allocate a unique execution scope beneath `{root}`")]
34 IdentityExhausted {
35 /// Parent directory in which allocation was attempted.
36 root: PathBuf,
37 },
38}