summaryrefslogtreecommitdiffstats
path: root/contrib/caldav
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/caldav')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index 3c544d6..0feed12 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -100,6 +100,11 @@ def remote_query(cmd, path, additional_headers, body):
if not resp:
return (None, None)
+ if resp.status - (resp.status % 100) != 200:
+ die(("The server at %s replied with HTTP status code %d (%s) " +
+ "while trying to access %s.") %
+ (hostname, resp.status, resp.reason, path))
+
headers = resp.getheaders()
body = resp.read().decode('utf-8')