Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/graph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2015-11-12 04:33:15 +0300
committerSoumith Chintala <soumith@gmail.com>2015-11-12 04:33:15 +0300
commitde75932719d256f43963f16e61b5b5593680c81a (patch)
tree1256421ed0e7e9bb8d5dd66f20cb40df799572c2
parenta5c365f9c86281807a47f43ce5aebbbf40e6719d (diff)
parent4c70719edd06edbb03f6b1d191a83d47d299b04a (diff)
Merge pull request #22 from torch/gvcheck
if graphviz not loaded, give appropriate error at runtime
-rw-r--r--graphviz.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/graphviz.lua b/graphviz.lua
index 14115cb..9b2afdb 100644
--- a/graphviz.lua
+++ b/graphviz.lua
@@ -148,6 +148,9 @@ function graph.graphvizLayout(g, algorithm)
end
function graph.graphvizFile(g, algorithm, fname)
+ if not graphvizOk or not cgraphOk then
+ error("graphviz library could not be loaded.")
+ end
algorithm = algorithm or 'dot'
local _,_,rendertype = fname:reverse():find('(%a+)%.%w+')
rendertype = rendertype:reverse()