Use the throw policy to throw an error when it is reached during the execution of an assembly flow.
|DataPower® Gateway (v5 compatible)||1.0.0|
|DataPower API Gateway||2.0.0
2.1.0 (DataPower API Gateway Version 10.0.3.0 or later)
This topic describes how to configure the policy in the assembly user interface; for details on how to configure the policy in your OpenAPI source, see throw.
When the throw policy is encountered, the specified error and error message is produced.
If a catch has been configured that the error produced by the throw policy fulfills, the catch will be triggered.
If no catch is triggered by the thrown error, then a 500 Internal Server Error is returned to the API caller.
Component property details
You can configure a component's properties in the property sheet in the assemble view.
|Title||No||A custom title for your component when it is displayed in the canvas. If a title is not
|Error name||Yes||The error name that is thrown by the policy.|
|Error status code (policy version 2.1.0 and later)||No||Specify the HTTP status code for the error. You can use the
|Error status reason (policy version 2.1.0 and later)||No||Specify the HTTP reason phrase for the error. You can use the
|Error message||No||The error message that is returned with the error name.|