Adjust: respond with 500 in case principal collection cannot be created (e.g. filesystem issues)

This commit is contained in:
Peter Bieringer
2026-04-18 16:20:55 +02:00
parent e998943a73
commit cd4d832003

View File

@@ -540,9 +540,13 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
except ValueError as e:
logger.warning("Failed to create predefined collection %r: %s", name_coll, e)
except ValueError as e:
logger.warning("Failed to create principal "
"collection %r: %s", user, e)
user = ""
logger.error("Failed to create principal "
"collection for user %r: ValueError %s", user, e)
return response(*httputils.INTERNAL_SERVER_ERROR)
except OSError as e:
logger.error("Failed to create principal "
"collection for user %r: OSerror %s", user, e)
return response(*httputils.INTERNAL_SERVER_ERROR)
else:
logger.warning("Access to principal path %r denied by "
"rights backend", principal_path)