5
 Followers
23
 Likes

Allow REST APIs errors don't be logged

Integration
New

My idea is to have a similar mechanism that is done with Exception Handlers to REST APIs errors, this is, the ability to choose if we want to log the error or not.


For example, in the OnAfterResponse of a REST API I would like to don't log the exception that occurs when condition 2 is true.

This exception is logged with the module REST (Consume).


Created on 21 Sep 2018
Comments (3)

Additional information: when an explicit error is thrown in the OnAfterResponse (like in the example above), or when a non-200-series status code is received (like a "403 forbidden"), the Error Log always shows the Exception, with Module "REST (Consume)". Since these kind of Exceptions or status codes are expected, and are handled in the Action that calls the REST API Method (where the developer can choose to log an error or not in the Exception Handler), these messages pollute the Error Log, and should imho simply not be there (note that if they are not handled by the caller, two exception messages are logged, which is a bit superfluous anyway).

I'm facing the exact same problem.

The API that I'm using sends a status code 404 when they don't have information but for me, that's not an error. I just want to handle it differently from the status code 200 and not log the error. 

Right now I have service center filled with this 404 errors and I cannot easily identify the "real" errors of my factory.

Changed the category to Integration


views
343
Followers
5