diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3d827cd..6662a046e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ 2.5.13 (FUTURE) +## Enhancements + +* [#3085](https://github.com/digitalocean/netbox/issues/3085) - Catch all exceptions during export template rendering + ## Bug Fixes * [#3132](https://github.com/digitalocean/netbox/issues/3132) - Circuit termination missing from available cable termination types diff --git a/netbox/utilities/views.py b/netbox/utilities/views.py index f52f4ea9e..8b92e5a59 100644 --- a/netbox/utilities/views.py +++ b/netbox/utilities/views.py @@ -126,10 +126,12 @@ class ObjectListView(View): queryset = CustomFieldQueryset(self.queryset, custom_fields) if custom_fields else self.queryset try: return et.render_to_response(queryset) - except TemplateSyntaxError: + except Exception as e: messages.error( request, - "There was an error rendering the selected export template ({}).".format(et.name) + "There was an error rendering the selected export template ({}): {}".format( + et.name, e + ) ) # Fall back to built-in CSV formatting if export requested but no template specified