Skip to main content

IssueCode

Enum IssueCode 

Source
#[non_exhaustive]
pub enum IssueCode {
Show 34 variants EmptyWorkflowId, EmptyWorkflowName, NoTasks, MissingStepId, DuplicateStepId, EmptyGroup, GroupTooDeep, MissingFunction, InvalidFunctionName, InvalidTerminal, UnguardedValidation, InvalidHaltOn, GroupContinueOnError, InvalidMapping, NullMapping, LoopIncrementTooSmall, LoopBoundEmpty, LoopCounterInvalid, LoopSlotInvalid, LoopItemWithoutOver, LoopSlotCollision, LoopOverInvalid, InvalidForEach, UnknownFunction, MissingHandler, InputParse, TemplateCompile, UnknownSecret, SecretInMessageWrite, InvalidSecretStore, DuplicateTemplateKey, EscapedTemplateKey, ParseFailed, ValidateFailed,
}
Expand description

What a check found wrong with a workflow definition.

Not every code is a refusal: Self::severity says whether the definition is rejected, builds and then fails every message, or merely carries a shape worth an author’s attention. Ask it rather than keeping a list — see Severity.

#[non_exhaustive]: a later minor may add a rule, and a host matching on the codes it cares about should keep compiling. Use Self::as_str to serialize.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

EmptyWorkflowId

id is missing or empty.

§

EmptyWorkflowName

name is missing or empty.

§

NoTasks

tasks is missing, not an array, or empty.

§

MissingStepId

A step carries no id.

§

DuplicateStepId

Two steps share an id. Groups share the task id namespace.

§

EmptyGroup

A group’s tasks is not a non-empty array.

§

GroupTooDeep

A group is nested at or beyond MAX_GROUP_DEPTH.

§

MissingFunction

A task carries no function.

§

InvalidFunctionName

function is not an object, or its name is missing or empty.

§

InvalidTerminal

terminal is present but not a boolean.

§

UnguardedValidation

A validation task whose failure cannot stop anything: it is not terminal, has no halt_on, and every task after it in the workflow is unguarded. A failing rule returns 400, which continue_on_error does not cover, so the pipeline proceeds as if it had passed.

Severity::Advisory — reported by crate::EngineBuilder::check_workflow and never by crate::EngineBuilder::build. Validating purely to record errors is a legitimate shape; this only says the assertion is not acting as a gate.

§

InvalidHaltOn

halt_on is present and is not one of the accepted strings, or is present on a group — a group has no outcome of its own, so the executor could not honour it.

§

GroupContinueOnError

A task group carries continue_on_error, which the engine drops. Error handling is per task and per workflow; a group only gates a span.

Severity::Advisory — reported by crate::EngineBuilder::check_workflow and never by crate::EngineBuilder::build. Unlike Self::InvalidHaltOn, which the parser refuses outright, this key is real at the other two levels and may already sit on a host’s group nodes; refusing it would abort every workflow in the build.

§

InvalidMapping

A map mapping breaks a rule between its keys: it has neither logic nor "unset": true, or both; it carries on_null without logic; or it would remove a context root (data, metadata, temp_data) by a literal path. Reported at the offending key, e.g. tasks[0].function.input.mappings[2].unset.

§

NullMapping

A map mapping whose logic always evaluates to null — "logic": null, or anything that folds to it — under the default on_null: "skip". A null result is skipped, so the mapping can never write anything; it usually stands where the author meant to clear the path, which is "unset": true.

Severity::Advisory — reported by crate::EngineBuilder::check_workflow and never by crate::EngineBuilder::build. The mapping is a no-op, not an error, and refusing it would fail every build that already carries one.

§

LoopIncrementTooSmall

loop.increment is below 1 — the counter would never reach max.

§

LoopBoundEmpty

loop.max is not greater than loop.init — no sweep could ever run.

§

LoopCounterInvalid

loop.counter is not a non-empty dotted path.

§

LoopSlotInvalid

loop.as or loop.scratch is not a non-empty dotted path.

§

LoopItemWithoutOver

loop.as names a slot for the current element, but there is no loop.over to take elements from.

§

LoopSlotCollision

Two of loop.counter, loop.as and loop.scratch name the same temp_data path, or one lies inside the other — a per-iteration reset of one would wipe the other. Reported at the later of the two fields.

§

LoopOverInvalid

loop.over can never yield an array: it is a scalar literal (a string, number, boolean or null), or loop.init is negative, which no array index can be. Reported at loop.over or loop.init respectively.

§

InvalidForEach

A task’s for_each breaks one of its rules — over a scalar literal, as not a slot path, max_concurrency of 0, collect without into or the reverse, a result path outside the context, a collect or into overlapping a binding — or sits on a built-in function, or on a task group. Reported at the offending key, e.g. tasks[0].for_each.max_concurrency, or at …for_each itself.

§

UnknownFunction

No handler will dispatch this function name, and it is not a built-in. Usually a typo or a handler the host forgot to register.

§

MissingHandler

The name is a built-in, but one that ships as a config schema only (http_call, enrich, publish_kafka) and no handler is registered under it. The workflow builds cleanly and then fails every message.

§

InputParse

A custom task’s input does not deserialize into its handler’s declared Input type.

§

TemplateCompile

A Template field of a custom task’s input does not compile.

§

UnknownSecret

An expression reads {"secret": "name"} and no secret of that name is declared on the engine (EngineBuilder::with_secrets). Only literal names are checked; a dynamic name fails at evaluation instead.

§

SecretInMessageWrite

An expression whose result the engine writes to the message or emits to a log reads a secret — a map mapping, or a log message or field. The store exists so a value is never recorded; an expression that would record it is refused outright, derived or not. Compute derived values in a custom handler.

§

InvalidSecretStore

The store passed to EngineBuilder::with_secrets is not a JSON object, so no name resolves and EngineBuilder::build will fail. Reported by EngineBuilder::check_workflow instead of the Self::UnknownSecret issues every literal name would otherwise produce — the workflow is not what is wrong.

Severity::Rejected, but the odd one out: quarantining the workflow will not make the build succeed, because the store is what is broken.

§

DuplicateTemplateKey

Two keys in one template object collapse to the same name once the template-key escape is stripped — {"$a": 1, "a": 2} emits a twice. The context is a Vec of pairs, so both survive: a later read sees only the first while serialization emits both. Always a bug, so crate::EngineBuilder::build refuses it.

§

EscapedTemplateKey

A template key carries the escape prefix, so it is emitted with one prefix stripped: $type emits type. Severity::Advisory — reported by crate::Engine::check_workflow and never by crate::EngineBuilder::build.

Exists for migration. The escape strips uniformly from every template key, so a workflow written before 3.9 that emits genuinely $-prefixed keys — MongoDB’s $set/$oid, JSON Schema’s $schema/$ref — changes what it produces, silently. This lists every one so the audit is mechanical rather than archaeological.

§

ParseFailed

The document does not deserialize into a Workflow. Carries the parser’s own message, which names the offending field and type.

§

ValidateFailed

The document parses but Workflow::validate rejects it. A backstop: reaching this means a rule exists that the checks above do not model.

Implementations§

Source§

impl IssueCode

Source

pub fn as_str(&self) -> &'static str

The stable string form, for serializing into an API response.

Source

pub fn severity(self) -> Severity

When an issue carrying this code bites — see Severity.

The match below has no wildcard arm, and must never gain one. That is the whole mechanism: a code added in a later minor stops this compiling until it is deliberately classified, so a new advisory code cannot arrive as a silent Rejected in a host’s pre-build screen — the direction that turns a screen into a quarantine.

Trait Implementations§

Source§

impl Clone for IssueCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for IssueCode

Source§

impl Debug for IssueCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for IssueCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for IssueCode

Source§

impl Hash for IssueCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for IssueCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IssueCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.