Add logic to raise exceptions when the HTTP status code is 400 or greater.
This is partly a hotfix for a 'quirk' in the UDM 3.2.7 firmware where occasionally the API would return {'error': {'code': 500, 'message': 'Internal Server Error'}}. Previously, this error was passed along as expected data but would cause an error when attempting to extract the X-CSRF token. This behavior seems to occur regularly, however the hard-coded 10 second timeout in async_timeout(), now asyncio.timeout(), would typically prevent the API from being able to send this response.
Additionally, an option to change the API timeout, in seconds, has been added.
Add logic to raise exceptions when the HTTP status code is 400 or greater.
This is partly a hotfix for a 'quirk' in the UDM 3.2.7 firmware where occasionally the API would return
{'error': {'code': 500, 'message': 'Internal Server Error'}}
. Previously, this error was passed along as expected data but would cause an error when attempting to extract the X-CSRF token. This behavior seems to occur regularly, however the hard-coded 10 second timeout inasync_timeout()
, nowasyncio.timeout()
, would typically prevent the API from being able to send this response.Additionally, an option to change the API timeout, in seconds, has been added.