From e494d2345c3c48c9427cd6bda6d6748a579e7177 Mon Sep 17 00:00:00 2001 From: Simon Brunning Date: Thu, 25 Jul 2024 10:32:36 +0100 Subject: [PATCH] Log this exception with stack trace to help with diagnosis. --- django_app/redbox_app/redbox_core/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django_app/redbox_app/redbox_core/models.py b/django_app/redbox_app/redbox_core/models.py index 712f8455e..3d0f9295a 100644 --- a/django_app/redbox_app/redbox_core/models.py +++ b/django_app/redbox_app/redbox_core/models.py @@ -222,7 +222,10 @@ def url(self) -> URL | None: @property def name(self) -> str: # User-facing name - return self.original_file_name or self.original_file.name + try: + return self.original_file_name or self.original_file.name + except ValueError as e: + logger.exception("attempt to access non-existent file %s", self.pk, exc_info=e) @property def unique_name(self) -> str: