Make sure promise is returned
This commit is contained in:
parent
9031400838
commit
0e04f78637
|
@ -109,9 +109,10 @@ if (Transaction) {
|
|||
cb = cb || utils.createPromiseCallback();
|
||||
// Report an error if the transaction is not active
|
||||
if (!self.connection) {
|
||||
return process.nextTick(function() {
|
||||
process.nextTick(function() {
|
||||
cb(new Error('The transaction is not active: ' + self.id));
|
||||
});
|
||||
return cb.promise;
|
||||
}
|
||||
var context = {
|
||||
transaction: self,
|
||||
|
@ -142,9 +143,10 @@ if (Transaction) {
|
|||
cb = cb || utils.createPromiseCallback();
|
||||
// Report an error if the transaction is not active
|
||||
if (!self.connection) {
|
||||
return process.nextTick(function() {
|
||||
process.nextTick(function() {
|
||||
cb(new Error('The transaction is not active: ' + self.id));
|
||||
});
|
||||
return cb.promise;
|
||||
}
|
||||
var context = {
|
||||
transaction: self,
|
||||
|
|
Loading…
Reference in New Issue