In the example for dataset.runInTransaction
(link), there is explicit error handling that occurs on transaction.get(key,callback)
.
But on other operations, such as transaction.save(entity)
or transaction.delete(key)
, there are no callbacks, so really no way to handle errors. For example:
dataset.runInTransaction(function(transaction, done) {
transaction.save({
key: dataset.key(['Company', 123]),
data: {}
});
transaction.delete(dataset.key(['Company', 456]));
done();
}, function(err, apiResponse) {});
Does this mean there is no need to explicitly rollback the transaction?