Skip to content

Commit

Permalink
Log graph on timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
soerendomroes committed Oct 22, 2024
1 parent 9476d2a commit c8056fa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c8056fa

Please sign in to comment.