all files / src/utils/ validation-error.js

40% Statements 2/5
100% Branches 0/0
0% Functions 0/1
40% Lines 2/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                            
module.exports = ValidationError;
 
/**
 * An Error object for validation errors with a text error name, translation key and params
 * @param {String} name The error name (e.g. 'name_already_used')
 * @param {String} translationKey A key to the translation file for this error text (eg. )
 * @param {[String]} params The error message params (e.g. ['General'])
 * @returns {ValidationError} The new ValidationError instance
 */
function ValidationError(name, translationKey, params) {
  this.name = name;
  this.translationKey = translationKey;
  this.params = params;
}