<#1671 feat: Attempt to parse response JSON for Fa...
# meltano-repo-activity
g
#1671 feat: Attempt to parse response JSON for Failures by default Issue created by visch ### Feature scope Taps (catalog, state, stream maps, etc.) ### Description In sdk/singer_sdk/streams/rest.py Line 147 in</meltano/sdk/commit/dfcec5fb4f26329f6f6963626b51003296240e0d|dfcec5f> | def validate_response(self, response: requests.Response) -> None: | | ----------------------------------------------------------------- | the msg doesn't include the response content. If we did something like
msg = self.response_error_message(response) + "\n" + str(response.json())
The data the comes back is so much more helpful in most cases. Wrapping that in a try catch and doing it by default seems appropriate. I've implemented this personally on >5 taps at this point. Behavior today:
Copy code
File "/home/visch/git/tap-zuora/.meltano/extractors/tap-zuora/venv/lib/python3.8/site-packages/singer_sdk/streams/rest.py", line 193, in validate_response
    raise FatalAPIError(msg)
singer_sdk.exceptions.FatalAPIError: 400 Client Error:  for path: /settings/entity-profile-info
Behavior after this:
Copy code
File "/home/visch/git/tap-zuora/.meltano/extractors/tap-zuora/venv/lib/python3.8/site-packages/singer_sdk/streams/rest.py", line 193, in validate_response
    raise FatalAPIError(msg)
singer_sdk.exceptions.FatalAPIError: 400 Client Error:  for path: /settings/entity-profile-info
{'errorCode': 'REMOTE_HTTP_CLIENT_ERROR', 'remoteHttpStatus': 403, 'messages': ['{"error":"403 Forbidden","processId":"D39CB301F868C6B2","message":"security.error.noPermission"}']}
meltano/sdk