aion_package/codegen/awl_worker/
error.rs1#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
10pub enum AwlScaffoldError {
11 #[error(
14 "the document's `worker {task_queue}` block declares no action for an out-of-band \
15 worker: every action it declares carries a `run` body, which the server executes \
16 itself. There is nothing for a worker to serve."
17 )]
18 NoServableAction {
19 task_queue: String,
21 },
22 #[error(
25 "the document's `worker {task_queue}` block has node-pinned worker-owed actions, but \
26 `aion worker shell` cannot express node topology: it has no node flag, registers with \
27 the machine hostname as its node, and its startup check demands the whole worker-owed \
28 action set regardless of pins. Use `aion awl scaffold`'s Rust crate, which opens one \
29 connection per node, for this queue."
30 )]
31 NodePinnedQueue {
32 task_queue: String,
34 },
35 #[error(
37 "action `{action}` of worker `{task_queue}` is not a Rust identifier, so the generated \
38 crate could not name a handler function after it"
39 )]
40 ActionNameNotAnIdentifier {
41 task_queue: String,
43 action: String,
45 },
46 #[error(
48 "action `{action}` of worker `{task_queue}` is named after the Rust keyword `{action}`, \
49 which has no raw-identifier form, so the generated crate could not name a handler \
50 function after it"
51 )]
52 ActionNameUnnameable {
53 task_queue: String,
55 action: String,
57 },
58 #[error(
60 "`{crate_name}` is not a usable Cargo package name; it must be non-empty and contain \
61 only ASCII letters, digits, `-`, and `_`"
62 )]
63 CrateNameInvalid {
64 crate_name: String,
66 },
67 #[error(
70 "the generated crate needs a {role} path to reach the AWL document, and an empty one \
71 was supplied"
72 )]
73 DocumentPathEmpty {
74 role: &'static str,
76 },
77 #[error("the declared {role} schema of action `{action}` could not be rendered: {reason}")]
79 SchemaUnrenderable {
80 action: String,
82 role: &'static str,
84 reason: String,
86 },
87}