Merge pull request #2738 from candlerb/candlerb/graphviz-exception

Show exception description on failure to render graphviz
This commit is contained in:
Jeremy Stretch 2019-01-16 16:02:11 -05:00 committed by GitHub
commit a950c95416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))