Skip to content
Snippets Groups Projects
Commit e022b95b authored by Sören Henning's avatar Sören Henning
Browse files

throw exception on failed edge adding

parent 61929863
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
Pipeline #
......@@ -33,6 +33,10 @@ class ExceptionFactory {
return new IllegalStateException("Edge with id does not exist: " + id);
}
public static IllegalStateException verticesAreNotInSameGraph(final Object id1, final Object id2) {
return new IllegalStateException("Vertices with ids are not in the same graph: " + id1 + ", " + id2);
}
public static IllegalArgumentException bothIsNotSupported() {
return new IllegalArgumentException("A direction of BOTH is not supported");
}
......
......@@ -89,8 +89,7 @@ public class GraphImpl extends ElementImpl implements Graph {
}
if (outVertexParents.peek().graph != inVertexParents.peek().graph) {
// throw exception TODO
throw new IllegalStateException();
throw ExceptionFactory.verticesAreNotInSameGraph(outVertex.getId(), inVertex.getId());
}
GraphImpl firstEqualParent = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment