Skip to content

Commit

Permalink
_query: Re-raise the errors.
Browse files Browse the repository at this point in the history
Though we were adding additionally logging to the errors we were
catching we weren't re-riasing them. Since we're a library we shouldn't
just handle and silence the errors that way as someone using us
then wouldn't be able to act on those exceptions.

Perhaps we need to wrap those into our own exceptions instead of
re-raising the ones from requests.
  • Loading branch information
Daniele Sluijters committed Aug 6, 2013
1 parent 54dc1de commit 794e9c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pypuppetdb/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,12 @@ def _query(self, endpoint, path=None, query=None, limit=None, offset=None):
log.error("{0} {1}:{2} over {3}.".format(ERROR_STRINGS['timeout'],
self.host, self.port,
self.protocol.upper()))
raise
except requests.exceptions.ConnectionError:
log.error("{0} {1}:{2} over {3}.".format(ERROR_STRINGS['refused'],
self.host, self.port,
self.protocol.upper()))
raise

# Method stubs

Expand Down

0 comments on commit 794e9c7

Please sign in to comment.