1 Answer
- Newest
- Most votes
- Most comments
0
It's almost impossible to guess the root cause of this issue given the provided information. It is always a good idea to handle known error-cases. If you log the response you may get additional information that leads you to the root cause.
To handle the error you could do:
try: result = json.loads(response.data) except json.decoder.JSONDecodeError: log(response) result = {}
answered a year ago
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
How does the response in those cases look like? Can you log the response structure in general and the
response.data
specifically? That would give you an idea what failed.Sorry for late response. The additional information, when successful response.data is in format {"token": "xyz"} and once it fails response.data = 'not ready to serve traffic, please wait'. Looks like there is some time delay sometimes here for the layer.