Skip to content

Commit

Permalink
extend error message for "Bad PUT request"
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiering committed May 18, 2024
1 parent 2296f49 commit 61fef9c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions radicale/app/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def do_PUT(self, environ: types.WSGIEnviron, base_prefix: str,
try:
content = httputils.read_request_body(self.configuration, environ)
except RuntimeError as e:
logger.warning("Bad PUT request on %r: %s", path, e, exc_info=True)
logger.warning("Bad PUT request on %r (read_request_body): %s", path, e, exc_info=True)
return httputils.BAD_REQUEST
except socket.timeout:
logger.debug("Client timed out", exc_info=True)
Expand All @@ -145,7 +145,7 @@ def do_PUT(self, environ: types.WSGIEnviron, base_prefix: str,
vobject_items = radicale_item.read_components(content or "")
except Exception as e:
logger.warning(
"Bad PUT request on %r: %s", path, e, exc_info=True)
"Bad PUT request on %r (read_components): %s", path, e, exc_info=True)
return httputils.BAD_REQUEST
(prepared_items, prepared_tag, prepared_write_whole_collection,
prepared_props, prepared_exc_info) = prepare(
Expand Down Expand Up @@ -199,7 +199,7 @@ def do_PUT(self, environ: types.WSGIEnviron, base_prefix: str,
props = prepared_props
if prepared_exc_info:
logger.warning(
"Bad PUT request on %r: %s", path, prepared_exc_info[1],
"Bad PUT request on %r (prepare): %s", path, prepared_exc_info[1],
exc_info=prepared_exc_info)
return httputils.BAD_REQUEST

Expand All @@ -216,7 +216,7 @@ def do_PUT(self, environ: types.WSGIEnviron, base_prefix: str,
self._hook.notify(hook_notification_item)
except ValueError as e:
logger.warning(
"Bad PUT request on %r: %s", path, e, exc_info=True)
"Bad PUT request on %r (create_collection): %s", path, e, exc_info=True)
return httputils.BAD_REQUEST
else:
assert not isinstance(item, storage.BaseCollection)
Expand All @@ -238,7 +238,7 @@ def do_PUT(self, environ: types.WSGIEnviron, base_prefix: str,
self._hook.notify(hook_notification_item)
except ValueError as e:
logger.warning(
"Bad PUT request on %r: %s", path, e, exc_info=True)
"Bad PUT request on %r (upload): %s", path, e, exc_info=True)
return httputils.BAD_REQUEST

headers = {"ETag": etag}
Expand Down

0 comments on commit 61fef9c

Please sign in to comment.