From 06f2f1c661515683f2a4ea1e320d71829875a984 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Mon, 7 Apr 2014 00:57:50 +0200 Subject: [PATCH] Prefer to log debug when it is not white listed --- headphones/request.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/headphones/request.py b/headphones/request.py index ed18f119..0e970f40 100644 --- a/headphones/request.py +++ b/headphones/request.py @@ -30,9 +30,8 @@ def request_response(url, method="get", auto_raise=True, whitelist_status_code=N # is white listed. if whitelist_status_code and auto_raise: if response.status_code not in whitelist_status_code: + logger.debug("Response status code %d is not white listed, raising exception", response.status_code) response.raise_for_status() - else: - logger.debug("Response Status code %d is white listed, not raising exception", response.status_code) elif auto_raise: response.raise_for_status()