ISOM-951: Better cloudmersive logging #1323
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
CloudMersove is supposed to return 200 for all scan calls, and the response body will indicate if the media contains viruses or not.
Unfortunately, we see instances where CloudMersive returns a 400, which means it is OUR error, since we are the one who make the call (it's not a client error). Our app correctly returns 500 when this happens because the 400 responses are not expected.
Unfortunately, our logging for CloudMersive errors only contains the http status message like so:
Which is not enough information for us to troubleshoot what about the request is wrong (e.g. a rate limit error? a body error? etc.)
Sample trace here
Solution
Improve cloudmersive logs so we can (hopefully) understand the error better, and we can also have some data about the typical viruses (if any) that CM finds for us.
Documentation is unfortunately sparse (see here), but we can see that we should have access to the
response
object, which should allow us see everything we need about the response (e.g. headers, body).This PR only includes non functional changes: it's just extra logging.
Tests