Skip to Content

Hello everybody,

with modern REST API we are facing the situation to handle different error types that we have to translate in a format the user can understand, espacially if we have a synchronous scenario.

In this example, we would like to perform a GET call to a REST API and catch all errors different to HTTP code 200 (which means OK). This is very generic error handling, but should be used as an easy example to understand the mechanism.


I create different message types for request and response. Here you can see the response message type:


As response structure, we create additionally to the normal fields an optional error structure. This structure will only be filled by REST adapter, if HTTP response is unequal 200.


Then I create a 1:1 message mapping for the“ request“ and the „response“.

But there is a special feature in the „response“ mapping. I created a UDF:


The UDF is used to generate an error message if an error occurs. So the message will visible as error in PIMON and the message is canceled. This UDF does not necessarily have to be used. It only serves as a feature.

The Argument „var1“ is only used as input for the UDF and will not be used.

The mapping for the field „errors“ looks like this:


Because I want to have a more informative error message in the PImon I configured an error handling in the REST adapter.

The expression „http_result“ is only entered in error handling.


There are the following additional expressions, which can be entered here:

from website:


Before the error-handling was inserted, the following error message appear in PIMON:


After configuration of the error-handling I get the following error message in PImon:


This error message is more meaningful than if I did not enter the error handling.


You could also add a receiver determination to check if the error structure exists and add an additional receiver e.g. to send an error alert via E-mail.


I hope this blog is helpul to understand.


Thank you,


To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Michelle Crapo

    It was great!

    So if you have a message number that is not defined – it will show up as the message sent from the API?

    I’m assuming you are only coding for the common errors?

    Thank you,



Leave a Reply