From f0649d00be15c63c4223993a0e4a375a6f49cc26 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Fri, 17 Apr 2026 14:38:22 -0700 Subject: [PATCH 1/3] Use correct method to write JSP error --- .../experiment/controllers/exp/experimentRunGraphView.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp index 01caafdfa75..0f7917c4db0 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp +++ b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp @@ -69,7 +69,7 @@ } catch (ExecuteException e) { - out.print("

Error rendering graph

"); + out.write("

Error rendering graph

"); } if (isSummaryView) From 42285fba3caf51543a9e55763f8aabd0a06f9d17 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Fri, 17 Apr 2026 14:52:39 -0700 Subject: [PATCH 2/3] Don't throw an exception if the graph is empty --- experiment/src/org/labkey/experiment/ExperimentRunGraph.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/experiment/src/org/labkey/experiment/ExperimentRunGraph.java b/experiment/src/org/labkey/experiment/ExperimentRunGraph.java index b9128794c0c..65eb1c0cabd 100644 --- a/experiment/src/org/labkey/experiment/ExperimentRunGraph.java +++ b/experiment/src/org/labkey/experiment/ExperimentRunGraph.java @@ -49,6 +49,10 @@ public static void renderSvg(Writer out, Container c, ExpRunImpl run, boolean de private static String getSvg(String dot) throws ExecuteException { Graphviz graph = DotParser.parse(dot); + + if (graph.isEmpty()) + return ""; // Graphviz.toSvgStr() throws an exception if the graph is empty. + String svg = graph.toSvgStr(); // Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than From 103a571feb5f3a869f852010aa7dfb12858f1de2 Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Fri, 17 Apr 2026 15:04:06 -0700 Subject: [PATCH 3/3] Log warning if graph SVG generation fails --- .../labkey/experiment/ExperimentRunGraph.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/experiment/src/org/labkey/experiment/ExperimentRunGraph.java b/experiment/src/org/labkey/experiment/ExperimentRunGraph.java index 65eb1c0cabd..cf7a52cb2d0 100644 --- a/experiment/src/org/labkey/experiment/ExperimentRunGraph.java +++ b/experiment/src/org/labkey/experiment/ExperimentRunGraph.java @@ -53,11 +53,19 @@ private static String getSvg(String dot) throws ExecuteException if (graph.isEmpty()) return ""; // Graphviz.toSvgStr() throws an exception if the graph is empty. - String svg = graph.toSvgStr(); + try + { + String svg = graph.toSvgStr(); - // Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than - // the old image-based ones, but monitors are much higher resolution than when those were scaled. - return SvgUtil.scaleSize(svg, 0.5f); + // Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than + // the old image-based ones, but monitors are much higher resolution than when those were scaled. + return SvgUtil.scaleSize(svg, 0.5f); + } + catch (ExecuteException ex) + { + LOG.warn("Error generating graph", ex); + throw ex; + } } private static String getDotGraph(Container c, ExpRunImpl run, boolean detail, String focus, String focusType)