Throw Error

Discover more about the Throw Error component and how to use it on the Digibee Integration Platform.

Throw Error throws an error inside a pipeline or subpipeline. It can be used to:

  • interrupt a pipeline with an error.

  • interrupt a component that uses subpipelines for processing.

Parameters

Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB).

ParameterDescriptionDefault valueData type

Error Message

Defines the error message that goes with the error code.

N/A

String

HTTP Status Code

Defines the code of the error (we use it based on HTTP errors code).

500-Internal Server Error

Integer

Enable Custom Error

Defines that the user wants to use a custom error.

False

Boolean

Custom Error (JSON)

Can be used to define a custom error message (in this case, HTTP Status Code and Error Message are ignored).

N/A

String

Throw Error in Action

Treating standard errors (customErrorEnabled)

Throw Error can be used to treat standard errors. Standard errors are those that follow the definitions of the Digibee Integration Platform and that contain a code and a message.

When this type of error results in the pipeline interruption, then the following output is produced:

{
  "timestamp": <a long number informing the timestamp when the error was generated>,
  "error": <the configured message>,
  "exception": "PipelineEngineRuntimeException",
  "code": <the configured code>
}

Treating custom errors

Throw Error can also be used to treat custom errors. In this case, a complete JSON object is informed in the component configuration and lately informed in the output of the error-resulting pipeline.

Some triggers, such as REST, HTTP, and HTTP File, need to receive a code and an error property in the pipeline output to prepare the return code of the HTTP call.

Components that use subpipelines

When Throw Error is used in a component that uses the onProcess subpipeline, the configured error is informed as the input of the onException subpipeline. If the Custom Error (JSON) option is filled, then the content of the JSON object is the same as the one described in the Treating standard errors or Treating custom errors sections.

To better understand the concept, read the article Subpipelines.

Last updated