From 4bf91f3ce036986b3215a1db1a6078885e2a9a2f Mon Sep 17 00:00:00 2001 From: Jeff Laughlin Date: Tue, 27 Sep 2016 08:23:03 -0400 Subject: [PATCH] fix qrz http resp code err handling --- hamtools/qrz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hamtools/qrz.py b/hamtools/qrz.py index f6264a9..e702e03 100755 --- a/hamtools/qrz.py +++ b/hamtools/qrz.py @@ -46,6 +46,9 @@ class NotFound(QrzError): class CallMismatch(QrzError): pass +class QrzRequestError(QrzError): + pass + class Callsign(object): conversions = dict( lat=float, @@ -98,7 +101,7 @@ class Session(object): hc.request("POST", "/xml", urllib.urlencode(params), headers) resp = hc.getresponse() if resp.status != httplib.OK: - raise Exception("Status %d" % resp.status) + raise QrzRequestError("Status %d" % resp.status) return resp.read()