From e5963b8a6b261f60f86e424c0005b6ac8096008d Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Tue, 25 Apr 2017 22:27:30 -0400 Subject: [PATCH] log errors on client if error --- hourglass/client/main/main.js | 3 ++- hourglass/server/main.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hourglass/client/main/main.js b/hourglass/client/main/main.js index c0833ca..d2978f0 100644 --- a/hourglass/client/main/main.js +++ b/hourglass/client/main/main.js @@ -858,8 +858,9 @@ sendData = function(funcName) { // Call Meteor function, and do actions after fu if(funcName === "editProfile") filterWork(); Meteor.call(funcName, serverData, function(error, result) { serverData = null; - if (error !== undefined) { + console.log(funcName); + console.log(error); sAlert.error(error.error[1] || error.message, { effect: 'stackslide', position: 'top' diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 3607477..16ffaab 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -515,7 +515,7 @@ Meteor.methods({ var security = securityCheck([[[8, 9, true], 16, false], 10, 20, 11, 12, true], Object.assign({}, found || {}, input, {userId: Meteor.userId()})); if (!security) { - input = Object.assign({}, input, {confirmations: [Meteor.userId()], reports: [], done: [], numberdone: 0, comments: []}); + input = Object.assign({}, input, {confirmations: [Meteor.userId()], reports: [], done: [], comments: []}); work.insert(input); } else { throw new Meteor.Error(errors[security]);