obrandDBWork/units/md-errors.js
Martin Donnelly 2b60bc78cf Init
2016-03-15 14:49:39 +00:00

33 lines
871 B
JavaScript

/**
*
* User: Martin Donnelly
* Date: 2016-03-10
* Time: 11:31
*
*/
var logger = require('log4js').getLogger();
var MDERRORS = new function() {
"use strict";
var errors = {
1000: {name:'Account error', title:'Signup data missing'},
1001: {name:'Account error', title:'Email address is not in the correct format'},
1002: {name:'Account error', title:'Required details missing'},
1003: {name:'Account error', title:'Email does not exist in login table'},
1004: {name:'Account error', title:'Email address or password are incorrect'}
};
this.error = function(code)
{
var estring = '';
estring = errors[code].name + ': ' + errors[code].title + '\nCode: ' + code + '\n';
logger.error(estring);
return({code:code, name:errors[code].name, title:errors[code].title, string:estring});
};
}();
module.exports = MDERRORS;