From c8056fabb0330f64c0f691fc3805564b62649e9e Mon Sep 17 00:00:00 2001 From: Soeren Domroes Date: Tue, 22 Oct 2024 10:44:37 +0200 Subject: [PATCH] Log graph on timeout. --- .../cau/cs/kieler/elkgraph/web/ElkGraphDiagramGenerator.xtend | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/elkgraph-web/src/main/java/de/cau/cs/kieler/elkgraph/web/ElkGraphDiagramGenerator.xtend b/server/elkgraph-web/src/main/java/de/cau/cs/kieler/elkgraph/web/ElkGraphDiagramGenerator.xtend index dad5aca..5d07346 100644 --- a/server/elkgraph-web/src/main/java/de/cau/cs/kieler/elkgraph/web/ElkGraphDiagramGenerator.xtend +++ b/server/elkgraph-web/src/main/java/de/cau/cs/kieler/elkgraph/web/ElkGraphDiagramGenerator.xtend @@ -22,6 +22,7 @@ import org.eclipse.elk.core.RecursiveGraphLayoutEngine import org.eclipse.elk.core.UnsupportedConfigurationException import org.eclipse.elk.core.options.CoreOptions import org.eclipse.elk.core.util.BasicProgressMonitor +import org.eclipse.elk.core.util.LoggedGraph import org.eclipse.elk.graph.ElkEdge import org.eclipse.elk.graph.ElkGraphElement import org.eclipse.elk.graph.ElkNode @@ -96,7 +97,8 @@ class ElkGraphDiagramGenerator implements IDiagramGenerator { processContent(laidOutGraph, sgraph) return sgraph } catch (TimeoutException ex) { - throw new RuntimeException("Layout timed out after " + timeoutInSeconds + " seconds.") + val loggedGraph = new LoggedGraph(EcoreUtil.copy(elkGraph), "TIMEOUT", LoggedGraph.Type.ELK) + throw new RuntimeException("Layout timed out after " + timeoutInSeconds + " seconds.\nGraph input: " + loggedGraph.serialize()) } catch (InterruptedException ex) { throw new RuntimeException(ex.message) } catch (ExecutionException ex) {