Skip to content

Commit

Permalink
fix(errors) Commits needed files
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgosera committed Nov 30, 2015
1 parent 9274d23 commit a01ca04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/errors/CustomValidationError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var util = require('util');

var CustomValidationError = function (message, property) {
Error.captureStackTrace(this, this);
this.message = message;
this.property = property;
};

util.inherits(CustomValidationError, Error);
CustomValidationError.prototype.name = 'CustomValidationError';

module.exports = CustomValidationError;
13 changes: 13 additions & 0 deletions lib/errors/TypeValidationError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var util = require('util');

var TypeValidationError = function (message, property, correctType) {
Error.captureStackTrace(this, this);
this.message = message;
this.property = property;
this.correctType = correctType;
};

util.inherits(TypeValidationError, Error);
TypeValidationError.prototype.name = 'TypeValidationError';

module.exports = TypeValidationError;

0 comments on commit a01ca04

Please sign in to comment.