From 05148cfba4537bb37a08c72d0ba7a0fe1805390e Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Fri, 8 Dec 2017 00:41:08 +0000 Subject: [PATCH] log error response writing to trough --- warcprox/trough.py | 4 ++++ 1 file changed, 4 insertions(+) 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)