private void fail(InsertException e, ClientContext context) { // Cancel all, then call the callback synchronized(this) { if(finished) return; finished = true; } cancelAndFinish(context); cb.onFailure(e, this); }
finished = true; cancelAndFinish(context); throw e;