throw

Use the throw construct to throw an error when it is reached during an assembly flow, usually as a result of a condition being reached.

The throw policy has the following format:
- throw:
   title: title
   name: 'error_name'
   message: error_message

When the throw policy is encountered, the specified error and error message is returned. If a catch has been configured that the error produced by the throw policy fulfills, the catch will be triggered.

Table 1. operation-switch policy properties
Property Required Description Data type
title No A title for the policy. string
name Yes The name of the error to be thrown. string
message Yes The message to accompany the error. string

Example

      - throw:
          title: throw
          name: '404'
          message: Not found