Skip to content

Commit

Permalink
All commands should pass comm errors up
Browse files Browse the repository at this point in the history
rtsp_url, storage_all, storage_used, storage_used_percent & storage_total caught comm errors. They should be passed up to let app deal with them.
  • Loading branch information
pnbruckner committed Apr 27, 2019
1 parent f95234f commit b1b809b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/amcrest/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def rtsp_url(self, channelno=None, typeno=None):
try:
port = ':' + [x.split('=')[1] for x in self.rtsp_config.split()
if x.startswith('table.RTSP.Port=')][0]
except (AmcrestError, IndexError):
except IndexError:
port = ''
return 'rtsp://{}:{}@{}{}/{}'.format(
self._user, self._password, self._host, port, cmd)
Expand Down
7 changes: 1 addition & 6 deletions src/amcrest/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ def storage_device_names(self):
return ret.content.decode('utf-8')

def _get_storage_values(self, *params):
try:
info = self.storage_device_info
except AmcrestError:
if len(params) == 1:
return None
return [None for i in range(len(params))]
info = self.storage_device_info
ret = []
for param in params:
try:
Expand Down

0 comments on commit b1b809b

Please sign in to comment.