Opus v0.3.1 Opus.Pipeline.Stage.Check
The check stage is intended to assert its input fulfils certain criteria otherwise the pipeline is halted.
Its implementation must return true
to proceed running any next steps.
When the check fails, an Atom error message is provided by default to allow for pattern-matching.
defmodule CreateUserPipeline do
use Opus.Pipeline
check :valid_params?, with: &UserValidator.validate/1
end
When the :valid_params?
check fails, the return value of the pipeline will be:
{:error, %Opus.PipelineError{error: :failed_check_valid_params?}}
Link to this section Summary
Functions
Callback implementation for Opus.Pipeline.Stage.run/2
Link to this section Functions
Link to this function
run(stage, input)
Callback implementation for Opus.Pipeline.Stage.run/2
.