From 60f718c2cea5488bb628d4cf3caab27ddd97baee Mon Sep 17 00:00:00 2001 From: Noam Date: Sun, 14 Feb 2016 11:28:06 +0200 Subject: [PATCH] Temporary Debugging Print source of exception --- headphones/request.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/headphones/request.py b/headphones/request.py index e29ce794..4f59396b 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -123,6 +123,14 @@ def request_response(url, method="get", auto_raise=True, "Request raise HTTP error with status code %d (%s).", e.response.status_code, cause) + # REMOVE LATER - FOR DEBUGGING + super_debug = True + if super_debug: + import os + exc_type, exc_obj, exc_tb = sys.exc_info() + fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] + logger.error('SUPER_DEBUG: ' + '; '.join([exc_type, fname, exc_tb.tb_lineno])) + # Debug response if headphones.VERBOSE: server_message(e.response)