Skip to content

Commit

Permalink
Catch OSError *and* socket.error in camera client
Browse files Browse the repository at this point in the history
  • Loading branch information
kk7ds committed Feb 23, 2016
1 parent f4a6b2b commit 238ab51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uvcclient/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import logging
import socket

# Python3 compatibility
try:
Expand Down Expand Up @@ -49,7 +50,7 @@ def _safe_request(self, *args, **kwargs):
conn = httplib.HTTPConnection(self._host, self._port)
conn.request(*args, **kwargs)
return conn.getresponse()
except OSError:
except (socket.error, OSError):
raise CameraConnectError('Unable to contact camera')
except httplib.HTTPException as ex:
raise CameraConnectError('Error connecting to camera: %s' % (
Expand Down

0 comments on commit 238ab51

Please # to comment.