-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Describe the bug
When using Smartsheet.request() the logic flow can result in the return of an OperationErrorResult object, which calls OperationErrorResult.native(). That method calls resp.json() [requests.Response.json()] outside of any try/except block which can cause the overall request logic to crash ungracefully - in my case, because of a likely empty JSON response causing JSONDecodeError: Expecting value: line 1 column 1 (char 0).
To my knowledge it isn't explicility mentioned if this is working as intended however does make the idea of the request_with_retry potentially redundant in these cases.
To Reproduce
Create a legitimate request which causes Smartsheets to return an empty JSON response.
In my case I use the client.Sheets.update_rows() when intermittently seeing this behaviour.
Expected behavior
Better handling of the failed request allowing for a retry.
Screenshots
N/A
Environment (please complete the following information):
- OS: All
- Smartsheet Python SDK Version [e.g. 3.0.4]
- Python Version [e.g. 3.12] (unsupported but seemingly irrelevant)