suggestion: Not to throw when no edges created.
See original GitHub issueCurrently, CREATE EDGE
throws an exception when FROM
statement or TO
statement were not found.
if (edges.isEmpty()) {
if (fromIds.isEmpty())
throw new OCommandExecutionException("No edge has been created because no source vertices");
else if (toIds.isEmpty())
throw new OCommandExecutionException("No edge has been created because no target vertices");
throw new OCommandExecutionException("No edge has been created between " + fromIds + " and " + toIds);
}
Imagine you want to create possibly multiple edges from a RID to a sub-query. The result of sub-query could be empty, it’s not deterministic. If you want to make sure that the edges will be created, than you should select-and-create in a transaction. Why don’t you let it go and just return a number of edges that actually created. I think it’s not only easier to handle it, but also give better performance.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Best Practices for exceptions - .NET - Microsoft Learn
This section describes best practices for handling and creating exceptions. ... Handle common conditions without throwing exceptions.
Read more >Creature under suggestion spell is attacked by caster, does ...
My questions are specifically: 1- Does creature B stop playing and try to defend from the attack? 2- Does the spell breaks? 3-...
Read more >Ch.7 Unit Test Flashcards - Quizlet
Study with Quizlet and memorize flashcards containing terms like Read this excerpt from "Look Homeward, Angel." And whatever he touched in that rich ......
Read more >Disable input text suggestions in Edge? - Stack Overflow
Added advantage is that it's pure HTML, no CSS or JS required. ... This worked for Edge & Chrome (not a login form...
Read more >Working Safely with Sharp Blades or Edges : OSH Answers
Place the tool at the back of the counter when not in use, with the sharp edge away from you. Store tools appropriately....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 It is really the behavior I expected. It is a hassle to have to be sure both source and destination sets are not empty before executing the create edge command, or to have to handle the exception messages.
Hi guys,
The general case is that you can create a set of edges from a set of vertices to another set of vertices.
By definition, sets can be empty, so it makes sense to just create no edges.
-1 to the idea of adding another keyword, the language is already too cluttered by keywords to manage corner cases, the statement will just return the number of edges that were created.