chatch PermissionError and respond 500

This commit is contained in:
Peter Bieringer
2026-03-21 08:31:26 +01:00
parent cc8f611075
commit a5e373c8c1

View File

@@ -549,8 +549,12 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
else:
profiler_active = True
status, headers, answer, xml_request = function(
environ, base_prefix, path, user, remote_host, remote_useragent)
try:
status, headers, answer, xml_request = function(
environ, base_prefix, path, user, remote_host, remote_useragent)
except PermissionError as e:
logger.error("PermissionError: %s", e)
status, headers, answer, xml_request = httputils.INTERNAL_SERVER_ERROR
# Profiling
if self._profiling_per_request: