OxL Reference

kw on_error

Contextual keyword — pipeline steps (§10.6)

The list of words: §1.4

Syntax

ebnf
Pipeline    = "pipeline" Ident "(" [ Params ] ")" "->" Type "{" PStep { "->" PStep } "}"
              [ "on_error" "(" Ident "," Ident ")" Block ] ;

Grammar: App. A

Defined in

  • 10.6 Pipelines — A pipeline is a linear chain of steps, each of which runs on its own node; data is passed from node to node directly, the caller receives on
  • 1.2 Statement termination — A statement is terminated by ; or by a line break.
  • 1.4 Keywords — Reserved (cannot be used as names)

Examples

oxl
pipeline uploadPhoto(img: Image) -> PhotoId {
  validate
  -> Store.put(it)              on storage
  -> respond it.id
  -> resize(it, THUMB_SIZES)    on gpu
  -> moderate                   on ml  durable
  -> SearchIndex.add(it)
} on_error(e, step) { Dlq.push(e, step) }

— 10.6 Pipelines

Related diagnostics

pipeline-idempotency, respond-twice, respond-type, unknown-role

See also