Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Feb 24, 2018
1 parent 6300836 commit b91ea1c
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions lib/task.js
Expand Up @@ -237,42 +237,42 @@ const execute = (ctx, obj, isTX, config) => {
spName = 'level_' + ctx.txLevel;
return begin()
.then(() => callback()
.then(data => {
cbData = data; // save callback data;
success = true;
return commit();
}, err => {
if (npm.utils.isConnectivityError(err)) {
// Cannot execute ROLLBACK after a connectivity error:
return $p.reject(err);
}
cbReason = err; // save callback failure reason;
return rollback();
})
.then(() => {
if (success) {
update(false, true, cbData);
return cbData;
}
update(false, false, cbReason);
return $p.reject(cbReason);
},
err => {
// either COMMIT or ROLLBACK has failed, which is impossible
// to replicate in a test environment, so skipping from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
}),
.then(data => {
cbData = data; // save callback data;
success = true;
return commit();
}, err => {
if (npm.utils.isConnectivityError(err)) {
// Cannot execute ROLLBACK after a connectivity error:
return $p.reject(err);
}
cbReason = err; // save callback failure reason;
return rollback();
})
.then(() => {
if (success) {
update(false, true, cbData);
return cbData;
}
update(false, false, cbReason);
return $p.reject(cbReason);
},
err => {
// BEGIN has failed, which is impossible to replicate in a test
// environment, so skipping the whole block from the test;
// either COMMIT or ROLLBACK has failed, which is impossible
// to replicate in a test environment, so skipping from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
});
}),
err => {
// BEGIN has failed, which is impossible to replicate in a test
// environment, so skipping the whole block from the test;
// istanbul ignore next:
update(false, false, err);
// istanbul ignore next:
return $p.reject(err);
});
}

function begin() {
Expand Down

0 comments on commit b91ea1c

Please sign in to comment.