ForestAdmin/forest-express-mongoose

View on GitHub
src/services/errors.js

Summary

Maintainability
A
2 hrs
Test Coverage
B
80%
function NoMatchingOperatorError(message) {
  this.name = 'NoMatchingOperatorError';
  this.message = message || 'The given operator is not handled.';
  this.stack = (new Error()).stack;
}
NoMatchingOperatorError.prototype = new Error();

function InvalidFiltersFormatError(message) {
  this.name = 'InvalidFiltersFormatError';
  this.message = message || 'The filters format is not a valid JSON string.';
  this.stack = (new Error()).stack;
}
InvalidFiltersFormatError.prototype = new Error();

function InvalidParameterError(message) {
  this.name = 'InvalidParameterError';
  this.message = message || 'The given parameter is invalid.';
  this.stack = (new Error()).stack;
}
InvalidParameterError.prototype = new Error();

exports.NoMatchingOperatorError = NoMatchingOperatorError;
exports.InvalidFiltersFormatError = InvalidFiltersFormatError;
exports.InvalidParameterError = InvalidParameterError;