From 8d6ff280e3b9c72c5ce834b2eb8ddeb245729872 Mon Sep 17 00:00:00 2001 From: Florian Streibelt Date: Wed, 12 Oct 2011 02:14:03 +0200 Subject: [PATCH] fix for exception handlibg if not an HTTP but URLError --- client-barcode/freitagskasse.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client-barcode/freitagskasse.py b/client-barcode/freitagskasse.py index f053109..1f4a5c5 100644 --- a/client-barcode/freitagskasse.py +++ b/client-barcode/freitagskasse.py @@ -352,11 +352,13 @@ def handle(line, status): else: try: status.login(line) - except urllib2.URLError as e: + except urllib2.HTTPError as e: if e.code == 404: # URL not found == user unknown error_page('FEHLER: Benutzer "%s" nicht bekannt' % line) else: error_page('FEHLER bei Kommunikation mit Server "%s"' % str(e)) + except urllib2.URLError as e: + error_page('FEHLER bei Kommunikation mit Server "%s"' % str(e)) def main():