-rw-r--r-- | backend/node/src/clipperz.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/node/src/clipperz.js b/backend/node/src/clipperz.js index 6c13f16..6bf56bb 100644 --- a/backend/node/src/clipperz.js +++ b/backend/node/src/clipperz.js @@ -53,33 +53,33 @@ var CLIPPERZ = module.exports = function(CONFIG) { var t1=new Date(), dt=t1-t0; LOGGER.trace({query:q,args:a,ms:dt,rows:r&&r.rowCount},"SQL query '%s' took %dms",q,dt); cb(e,r); }); }, commit: function(cb) { LOGGER.trace('SQL: commit'); if(this.over) return cb(new Error('game over')); return (this.over=true),C.query('COMMIT',function(e){D();cb&&cb(e)}); }, rollback: function(cb) { LOGGER.trace('SQL: rollback'); if(this.over) return cb(new Error('game over')); return (this.over=true),C.query('ROLLBACK',function(e){D();cb&&cb(e)}); }, end: function(e,cb) { - if(e) LOGGER.trace(e,"rolling back transaction due to an error"),this.rollback(cb); + if(e) return LOGGER.trace(e,"rolling back transaction due to an error"),this.rollback(cb); this.commit(cb); } }); }); }); } }; return { json: function clipperz_json(req,res,cb) { var method = req.body.method, pp = JSON.parse(req.body.parameters).parameters; var message = pp.message; var ppp = pp.parameters; res.res = function(o) { return res.json({result:o}) }; |