소스 검색

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
Brian Candler 7 년 전
부모
커밋
c58166137c
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      netbox/extras/api/views.py

+ 2 - 3
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))