FailsBuilder

Builder for "fails with reason" DSL syntax.

Usage:

  • fails with "Invalid order" (String)

  • fails with FailureReason.INVALID_ORDER (Enum)

Note: This builder throws StepFailureSignal to immediately exit the step. No explicit return is needed after fails with.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
infix inline fun <E : Enum<E>> with(reason: E): Nothing

Fails the step with an enum reason (preserves enum instance). Throws StepFailureSignal to immediately exit the step and trigger compensation.

infix fun with(reason: String): Nothing

Fails the step with a string reason. Throws StepFailureSignal to immediately exit the step and trigger compensation.