Skip to content

Commit 011b3f9

Browse files
committed
improve exception about missing rasterizer
1 parent 6e7c1f7 commit 011b3f9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graphviz-java/src/main/java/guru/nidi/graphviz/engine/Graphviz.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ public Graphviz filter(GraphvizFilter filter) {
226226

227227
public Renderer rasterize(@Nullable Rasterizer rasterizer) {
228228
if (rasterizer == null) {
229-
throw new IllegalArgumentException("The provided rasterizer implementation was not found. "
230-
+ "Make sure that the batik-rasterizer or svg-salamander jar is available on the classpath.");
229+
throw new IllegalArgumentException("The provided rasterizer implementation was not found."
230+
+ " Make sure that either 'guru.nidi.com.kitfox:svgSalamander' or"
231+
+ " 'org.apache.xmlgraphics:batik-rasterizer' is available on the classpath.");
231232
}
232233
final Options opts = options.format(rasterizer.format());
233234
final Graphviz graphviz = new Graphviz(graph, src, rasterizer, processOptions, opts, filters);

graphviz-java/src/main/java/guru/nidi/graphviz/engine/Renderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ private BufferedImage toImage(EngineResult result) {
112112
private BufferedImage toImage(String content) {
113113
if (graphviz.rasterizer == null) {
114114
throw new IllegalStateException("- Rasterizer explicitly set no null or\n"
115-
+ "- neither Batik nor Salamander found on classpath.");
115+
+ "- neither 'guru.nidi.com.kitfox:svgSalamander' nor 'org.apache.xmlgraphics:batik-rasterizer'"
116+
+ " found on classpath.");
116117
}
117118
return graphviz.rasterizer.rasterize(graphviz, graphicsConfigurer, content);
118119
}

0 commit comments

Comments
 (0)