mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
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
This commit is contained in:
@ -99,10 +99,9 @@ class TopologyMapViewSet(ModelViewSet):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
data = tmap.render(img_format=img_format)
|
data = tmap.render(img_format=img_format)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
return HttpResponse(
|
return HttpResponse(
|
||||||
"There was an error generating the requested graph. Ensure that the GraphViz executables have been "
|
"There was an error generating the requested graph: %s" % e
|
||||||
"installed correctly."
|
|
||||||
)
|
)
|
||||||
|
|
||||||
response = HttpResponse(data, content_type='image/{}'.format(img_format))
|
response = HttpResponse(data, content_type='image/{}'.format(img_format))
|
||||||
|
Reference in New Issue
Block a user