Skip to content

Commit

Permalink
Add error handler and logging for indexError
Browse files Browse the repository at this point in the history
  • Loading branch information
greengiant committed Feb 2, 2020
1 parent 6dd08a1 commit f0311da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/badnest/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ def update_camera(self, camera):
_LOGGER.debug('Failed to update, trying to log in again')
self.login()
self.update_camera(camera)
except IndexError:
_LOGGER.error('Invalid Response:'+ r.text())
_LOGGER.error('Failed to update, trying again')
self.login()
self.update_camera(camera)

def update(self):
try:
Expand Down

0 comments on commit f0311da

Please sign in to comment.