all files / ErrorHandling/ constants.js

100% Statements 15/15
100% Branches 0/0
100% Functions 0/0
100% Lines 15/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                               
/*
** Sequelize error code series starts from 1001
** Cassandra error code series starts from 2001
** undefined error code series starts from 3001
** Business logic error code series starts from 5001
** Internal error code series starts from 7001
*/
 
var constants = {};
 
constants.SUCCESS = 200;
constants.CREATED= 201;
 
constants.SEQUELIZE_DATABASE_ERROR = 1001;
constants.SEQUELIZE_VALIDATION_ERROR = 1002;
 
constants.CASSANDRA_DATABASE_ERROR = 2001;
constants.CASSANDRA_VALIDATION_ERROR = 2002;
 
constants.UNDEFINED_DATABASE_ERROR= 3001;
constants.UNDEFINED_ERROR= 3002;
 
constants.USER_DUPLICATION_ERROR = 5001;
 
constants.INVALID_JSON_OBJECT = 7001;
 
constants.SEQUELIZE_DATABASE_ERROR_NAME= 'SequelizeDatabaseError';
constants.SEQUELIZE_VALIDATION_ERROR_NAME='SequelizeValidationError';
constants.CASSANDRA_VALIDATION_ERROR_NAME= 'apollo.model.validator.invalidvalue';
 
module.exports = constants;