mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
Add request method and path to error message
This commit is contained in:
parent
276de4fd3a
commit
68184858b4
1 changed files with 10 additions and 2 deletions
|
@ -297,8 +297,16 @@ class Application:
|
||||||
try:
|
try:
|
||||||
status, headers, answers = self._handle_request(environ)
|
status, headers, answers = self._handle_request(environ)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error("An exception occurred during request: %s",
|
try:
|
||||||
e, exc_info=True)
|
method = str(environ["REQUEST_METHOD"])
|
||||||
|
except Exception:
|
||||||
|
method = "unknown"
|
||||||
|
try:
|
||||||
|
path = str(environ.get("PATH_INFO", ""))
|
||||||
|
except Exception:
|
||||||
|
path = ""
|
||||||
|
self.logger.error("An exception occurred during %s request on %r: "
|
||||||
|
"%s", method, path, e, exc_info=True)
|
||||||
status, headers, answer = INTERNAL_SERVER_ERROR
|
status, headers, answer = INTERNAL_SERVER_ERROR
|
||||||
status = "%d %s" % (
|
status = "%d %s" % (
|
||||||
status, client.responses.get(status, "Unknown"))
|
status, client.responses.get(status, "Unknown"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue