Skip to content

Commit

Permalink
better exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
twrecked committed Sep 6, 2019
1 parent 267a9b3 commit a520ebb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
0.0.2: Added manifest to aarlo

aarlo:
0.5.8: mirror pyaarlo version
0.5.7: fixed crash in handle_async_mjpeg_stream
0.5.6: mirror pyaarlo version
0.5.5: Rename 'object' variable in library
Expand All @@ -25,6 +26,7 @@ aarlo:
0.0.4: mirror pyaarlo version

pyaarlo:
0.5.8: improved exception reporting
0.5.7: mirror aarlo version
0.5.6: initial Ultra support
0.5.5: mirror aarlo version
Expand Down
4 changes: 2 additions & 2 deletions custom_components.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"aarlo": {
"version": "0.5.7",
"version": "0.5.8",
"local_location": "/custom_components/aarlo/__init__.py",
"remote_location": "https://raw.githubusercontent.com/twrecked/hass-aarlo/master/custom_components/aarlo/__init__.py",
"visit_repo": "https://github.com/twrecked/hass-aarlo",
Expand All @@ -15,7 +15,7 @@
]
},
"pyaarlo": {
"version": "0.5.7",
"version": "0.5.8",
"local_location": "/custom_components/aarlo/pyaarlo/__init__.py",
"remote_location": "https://raw.githubusercontent.com/twrecked/hass-aarlo/master/custom_components/aarlo/pyaarlo/__init__.py",
"visit_repo": "https://github.com/twrecked/hass-aarlo",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from homeassistant.const import (
CONF_USERNAME, CONF_PASSWORD, CONF_SCAN_INTERVAL)

__version__ = '0.5.7'
__version__ = '0.5.8'

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/pyaarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

_LOGGER = logging.getLogger('pyaarlo')

__version__ = '0.5.7'
__version__ = '0.5.8'

class PyArlo(object):

Expand Down
5 changes: 4 additions & 1 deletion custom_components/aarlo/pyaarlo/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def _run_next( self ):

# run it
#print( 'run:' + str(int(time.monotonic())) + ' run_at=' + str(run_at) )
job['callback']( **job['args'] )
try:
job['callback'](**job['args'])
except Exception as e:
self.log.debug('job-error={}'.format(type(e).__name__))

# reschedule?
self._lock.acquire()
Expand Down
2 changes: 1 addition & 1 deletion custom_components/aarlo/pyaarlo/sseclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __next__(self):
self.buf += decoder.decode(next_chunk)

except (StopIteration, requests.RequestException, EOFError, six.moves.http_client.IncompleteRead) as e:
self.log.debug(e)
self.log.debug('sseclient-error={}'.format(type(e).__name__))
time.sleep(self.retry / 1000.0)
self._connect()

Expand Down

0 comments on commit a520ebb

Please sign in to comment.