Q:

OrientDB REST API ignoreError

here is my daily OrientDB question:
Is it possible to ignore errors during the execution of a batch of commands via the REST API?
I am creating edges between nodes with commands like 
CREATE EDGE ManagedBy FROM (SELECT FROM Employee WHERE account = '<theId>') TO (SELECT FROM Employee WHERE account = '<theId>')

The fact is that sometimes the specified accounts are not in the DB, thus I obtain the following error:
Error:com.orientechnologies.orient.core.exception.OCommandExecutionException: No edge has been created because no source vertices

Since I am fine with the fact that I cannot create some edge, I would like to skip the returned error in order to insert as much edges as possible.
For the moment I'm inserting the edges one by one, I think that using a batch insert would speed up a lot the process.

A:

In the end I followed the advice of @wolf4ood: I created an insert_edge JS server function which I call for each edge I want to create. 
If the target and source node exist the edge is created, otherwise no action is taken. Here is its body:
var g = orient.getGraph();
var fromQ = "SELECT FROM " + fromTable + " WHERE " + fromField + " = '" + fromValue + "';";
var toQ = "SELECT FROM " + toTable + " WHERE " + toField + " = '" + toValue + "';";

var from = g.command('sql', fromQ, []);
var to = g.command('sql', toQ, []);

if(from.length > 0 && to.length > 0) {
    var createQ = "CREATE EDGE " + edgeType + " FROM (SELECT FROM " + fromTable + " WHERE " + fromField + " = '" + fromValue + "')" + " TO (SELECT FROM " + toTable + " WHERE " + toField + " = '" + toValue + "');";

    return g.command('sql', createQ, []);
}

return null;

The parameters are fromTable, fromField, fromValue, sourceTable, sourceField, sourceValue, edgeType.
I called the function in this way: 
SELECT insert_edge('Employee', 'account', <theId>, 'Employee', 'account', <theManager>, 'ManagedBy')

