fixed error on bad data treatment in res.notFound method

parent d8b5493a
......@@ -270,7 +270,7 @@ module.exports = {
})
.catch(function (err) {
res.notFound();
res.notFound(err);
});
},
......
......@@ -29,7 +29,7 @@ module.exports = function notFound (data, options) {
// Log error to console
if (data !== undefined) {
sails.log.verbose('Sending 404 ("Not Found") response: \n',data);
sails.log.verbose('Sending 404 ("Not Found") response: \n', JSON.stringify(data));
}
else sails.log.verbose('Sending 404 ("Not Found") response');
......
......@@ -144,9 +144,9 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
})
.error(function (err) {
console.log(err);
if (err.message && err.message.search('nvalid license'))
if (err.message && err.message.search('nvalid license') > 0)
ngToast.danger({ content: $translate.instant('license_invalid') });
else if (err.message && err.message.search('in use'))
else if (err.message && err.message.search('in use') > 0)
ngToast.danger({ content: $translate.instant('license_already_activated') });
else
ngToast.danger({ content: $translate.instant('student_not_updated') });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment