cancel
Showing results for 
Search instead for 
Did you mean: 

Binary output - error pipeline - custom http codes

Szymon
New Contributor II

There is a requirement for the following:
Error pipeline for an ultra pipeline which responses with custom HTTP code, e.g. 500.
Why:
…The third party API caller shall receive a proper HTTP code, not only HTTP 200 with error message.
…Or when the pipeline goes into an error it will receive 504 gateway timeout, just because, on standard snaplogic i unable to catch the errors.

So:
…I have implemented the ultra pipeline(A) and implemented error pipeline(B).
…In the ultra(A) i have configured the error pipeline(B), so all the snaps use that error pipeline.
…In the error pipeline(B), depending on the error, i have implemented custom error codes using Mapper Snap (Document → Binary), see pic below.

image

BUT, when I save the pipeline(A) and the engine tries to initialize the ultra pipeline, i get the message from the engine:

Error pipeline does not meet the requirements
Reason: An unlinked output must be available when an error pipeline is used with an Ultra pipeline
Resolution: Please redesign the error pipeline to have a single unlinked document output view

  1. is it not possible to have a binary output in ultra error pipeline(B)? YES or NO
  2. what is the alternative to output custom error codes from error pipeline(B), so the calling party sees, not HTTP 200, but HTTP 500? I DO NOT WANT to use Error View at the particular snaps in Ultra pipeline(A)!

Any ideas?

1 ACCEPTED SOLUTION

Hi @Szymon,

I created a sample ultra pipeline with an error pipeline and you actually can’t have an open binary output view on the error pipeline, it has to be document output view. However, you can still manipulate the status code for the error message.
This is a simple error pipeline that outputs the error message if there are any errors from the main pipeline.
image
image

If you call this API and if the pipeline has an error, for example you’ll receive the following response based on the configuration of the mapper snap in the error pipeline:

image
You can notice that the status in the response corresponds to the status in the Mapper snap.

View solution in original post

6 REPLIES 6

Hi @Szymon,

I created a sample ultra pipeline with an error pipeline and you actually can’t have an open binary output view on the error pipeline, it has to be document output view. However, you can still manipulate the status code for the error message.
This is a simple error pipeline that outputs the error message if there are any errors from the main pipeline.
image
image

If you call this API and if the pipeline has an error, for example you’ll receive the following response based on the configuration of the mapper snap in the error pipeline:

image
You can notice that the status in the response corresponds to the status in the Mapper snap.

Szymon
New Contributor II

Thank you again.
I have tried this approach last week without success. Both binary and document view using the maping table - see initial post.
In the meantime on monday we had system upgrade.
Anyways, it does work, the document output view like I have designed it in the first place, and what you have confirmed.
So thank you again, your response triggered us to try it out again.
kind regards.