throw

Full name: taxi.stdlib.throw

Signature

declare function throw(error:Any):Nothing

Description

Throws an error, halting execution. Useful for enforcing invariants inline.

find { order: Order } as {
   status: OrderStatus = when {
      OrderStatus == 'INVALID' -> throw('Order status is invalid')
      else -> OrderStatus
   }
}
Next
Welcome to Taxi