Catch error and proceed with other transformer

There are times that I need to proceed with a flow even though an http transformer fails. With this, i have some questions.

  • How do i continue a task even though a transformer failed?
    Use case is when i fetch a product, and it doesnt exist, it will throw an error. After this, I need to post a product since it doesnt exist. But the current flow just stops everything from the error point.

  • The other one is how to mock an error? Use case is when I submit a PUT request, it will return 200, but returns relevant data with message : Invalid. How do I make the request fail so it notifies as failure?

Hi @brethren,

I will try to answer your questions.

  • You can use a conditional transformer to run another transformer if the product doesn’t exist. But does the response have a 4xx http code?

  • If the response was 200, you can mark the task as “skipped” and catch the message. In general you can’t mark the task as failed if the HTTP Response is 200.

Hi. @r.candrian

  • the problem here, is that the api is an error as mentioned in my initial post. so it stops. i want to catch this 400 error so i can proceed with the next transformer.

  • how can I check and mark a task as skipped? is this a setting in the routes?