#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum AwlScaffoldError {
#[error(
"the document's `worker {task_queue}` block declares no action for an out-of-band \
worker: every action it declares carries a `run` body, which the server executes \
itself. There is nothing for a worker to serve."
)]
NoServableAction {
task_queue: String,
},
#[error(
"the document's `worker {task_queue}` block has node-pinned worker-owed actions, but \
`aion worker shell` cannot express node topology: it has no node flag, registers with \
the machine hostname as its node, and its startup check demands the whole worker-owed \
action set regardless of pins. Use `aion awl scaffold`'s Rust crate, which opens one \
connection per node, for this queue."
)]
NodePinnedQueue {
task_queue: String,
},
#[error(
"action `{action}` of worker `{task_queue}` is not a Rust identifier, so the generated \
crate could not name a handler function after it"
)]
ActionNameNotAnIdentifier {
task_queue: String,
action: String,
},
#[error(
"action `{action}` of worker `{task_queue}` is named after the Rust keyword `{action}`, \
which has no raw-identifier form, so the generated crate could not name a handler \
function after it"
)]
ActionNameUnnameable {
task_queue: String,
action: String,
},
#[error(
"`{crate_name}` is not a usable Cargo package name; it must be non-empty and contain \
only ASCII letters, digits, `-`, and `_`"
)]
CrateNameInvalid {
crate_name: String,
},
#[error(
"the generated crate needs a {role} path to reach the AWL document, and an empty one \
was supplied"
)]
DocumentPathEmpty {
role: &'static str,
},
#[error("the declared {role} schema of action `{action}` could not be rendered: {reason}")]
SchemaUnrenderable {
action: String,
role: &'static str,
reason: String,
},
}