diff --git a/warcprox/trough.py b/warcprox/trough.py index 97912b0..2848bbe 100644 --- a/warcprox/trough.py +++ b/warcprox/trough.py @@ -176,6 +176,10 @@ class TroughClient(object): try: response = requests.post(write_url, sql, timeout=600) + if response.status_code != 200: + raise Exception( + 'Received %s: %r in response to POST %s with data %r' % ( + response.status_code, response.text, write_url, sql)) if segment_id not in self._dirty_segments: with self._dirty_segments_lock: self._dirty_segments.add(segment_id)