error-handlingbiztalkerror-suppression

Suppress API 404 error from appearing in BizTalk console


I have a BizTalk app that calls an API from one of our suppliers. The orchestration receives a list of users and a list of subscriptions for that user. It then goes on to check whether the user exists, and if so, it posts them into the user table. It then goes on to post or update the subscription records, within another table.

The issue is that the call I have to make to the API to see whether a user exists returns a 404 error if they don't. I can account for this within the orchestration using a catch exception, so that if we receive a 404 error saying the user doesn't exist, it then creates a record for them and continues to create or update the subscriptions. However, by this point it's already been through the send port, and therefore creates an error in the console, even though this is a false error as the user not existing is to be expected in most cases.

Is there a way I can somehow suppress this particular error message, so it doesn't appear in the console?

I have checked with the supplier and there is currently no call I can make for the 'does user exist?' check that won't return a 404 error if they don't. The only other call I could make is to try and insert the user without checking whether they exist, in which case it returns a 404 error if they already do, which leaves me with the same issue. I don't unfortunately know anything about rerouting errors in BizTalk, but I'm hoping there's a way to tell BizTalk to ignore an error if the response contains 'user doesn't exist'.

Even if I can just reroute this error to a file somewhere, and have it not appear as an error in the console, this would suffice.


Solution

  • I'm assuming you are talking about suspended messages.

    Simply enable Routing for Failed messages on the port, and either have a port or an Orchestration subscribe to them with a filter like ErrorReport.FailureCode Exists, and have that send port either write to them a file location that gets purged, or a custom adapter that just throws the message away.

    enter image description here