calcurse-caldav: Show debug output before checking status
Make sure we print the headers and the body of a HTTP response in debug mode, even if the HTTP status code indicates failure. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
b9d80c3cf4
commit
7e7d21722a
@ -102,11 +102,6 @@ def remote_query(cmd, path, additional_headers, body):
|
|||||||
if not resp:
|
if not resp:
|
||||||
return (None, None)
|
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()
|
headers = resp.getheaders()
|
||||||
body = resp.read().decode('utf-8')
|
body = resp.read().decode('utf-8')
|
||||||
|
|
||||||
@ -116,6 +111,11 @@ def remote_query(cmd, path, additional_headers, body):
|
|||||||
print("< " + line)
|
print("< " + line)
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
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))
|
||||||
|
|
||||||
return (headers, body)
|
return (headers, body)
|
||||||
|
|
||||||
def get_hrefmap(conn, uid=None):
|
def get_hrefmap(conn, uid=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user