From d8f93c04c04fe7bee21c4a787868c037a44f3902 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 1 Jul 2015 11:31:44 +0200 Subject: [PATCH] Log for db --- posts/arrow-clicked/index.js | 2 ++ posts/coin-clicked/index.js | 2 ++ posts/fps/index.js | 2 ++ posts/hovered/index.js | 2 ++ posts/keyboard-event/index.js | 2 ++ posts/previous-next-clicked/index.js | 2 ++ posts/reset-clicked/index.js | 2 ++ 7 files changed, 14 insertions(+) diff --git a/posts/arrow-clicked/index.js b/posts/arrow-clicked/index.js index 5ef4910..9fb61cc 100644 --- a/posts/arrow-clicked/index.js +++ b/posts/arrow-clicked/index.js @@ -8,6 +8,8 @@ module.exports.index = function(req, res) { "INSERT INTO arrowclicked(exp_id, arrow_id, time) VALUES($1,$2, to_timestamp($3));", [req.session.exp_id, req.body.arrow_id, req.body.time], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } ); diff --git a/posts/coin-clicked/index.js b/posts/coin-clicked/index.js index 0c30bbd..0ae7c37 100644 --- a/posts/coin-clicked/index.js +++ b/posts/coin-clicked/index.js @@ -8,6 +8,8 @@ module.exports.index = function(req, res) { "INSERT INTO coinclicked(exp_id, coin_id, time) VALUES($1,$2, to_timestamp($3));", [req.session.exp_id, req.body.coin_id, req.body.time], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } ); diff --git a/posts/fps/index.js b/posts/fps/index.js index 445e5b2..a0344ae 100644 --- a/posts/fps/index.js +++ b/posts/fps/index.js @@ -8,6 +8,8 @@ module.exports.index = function(req, res) { "INSERT INTO fpscounter(exp_id, fps) VALUES($1,$2);", [req.session.exp_id, req.body.fps], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } ); diff --git a/posts/hovered/index.js b/posts/hovered/index.js index 37f3663..2ea2735 100644 --- a/posts/hovered/index.js +++ b/posts/hovered/index.js @@ -14,6 +14,8 @@ module.exports.index = function(req, res) { req.body.arrow_id ], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } ); diff --git a/posts/keyboard-event/index.js b/posts/keyboard-event/index.js index e0e4f1b..122eaae 100644 --- a/posts/keyboard-event/index.js +++ b/posts/keyboard-event/index.js @@ -20,6 +20,8 @@ module.exports.index = function(req, res) { req.body.time ], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } ); diff --git a/posts/previous-next-clicked/index.js b/posts/previous-next-clicked/index.js index c4afaa8..59c8fae 100644 --- a/posts/previous-next-clicked/index.js +++ b/posts/previous-next-clicked/index.js @@ -19,6 +19,8 @@ module.exports.index = function(req, res) { req.body.camera.target.z ], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } ); diff --git a/posts/reset-clicked/index.js b/posts/reset-clicked/index.js index 31c8676..7845735 100644 --- a/posts/reset-clicked/index.js +++ b/posts/reset-clicked/index.js @@ -12,6 +12,8 @@ module.exports.index = function(req, res) { req.body.time ], function(err, result) { + if (err !== null) + console.log("[DBERROR] " + err); release(); } );