From c58166137c6d29c0891a2bb07ad3bc9208b87fd3 Mon Sep 17 00:00:00 2001 From: Brian Candler Date: Tue, 1 Jan 2019 11:36:29 +0000 Subject: [PATCH] Show exception description on failure to render graphviz This means that problems give a more specific reason. In the event that dot is not found, the error is now: There was an error generating the requested graph: failed to execute ['dot', '-Tpng'], make sure the Graphviz executables are on your systems' PATH --- netbox/extras/api/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/netbox/extras/api/views.py b/netbox/extras/api/views.py index 637ef235b..0453b1f1c 100644 --- a/netbox/extras/api/views.py +++ b/netbox/extras/api/views.py @@ -99,10 +99,9 @@ class TopologyMapViewSet(ModelViewSet): try: data = tmap.render(img_format=img_format) - except Exception: + except Exception as e: return HttpResponse( - "There was an error generating the requested graph. Ensure that the GraphViz executables have been " - "installed correctly." + "There was an error generating the requested graph: %s" % e ) response = HttpResponse(data, content_type='image/{}'.format(img_format))