Compare commits
3 Commits
696492df7f
...
39a15a0bf9
Author | SHA1 | Date |
---|---|---|
Sven Slootweg | 39a15a0bf9 | 4 years ago |
Sven Slootweg | 8cdceffb15 | 4 years ago |
Sven Slootweg | 73838db4b5 | 4 years ago |
@ -1,12 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
const createError = require("create-error");
|
||||
// NOTE: We don't actually inherit from the real Error here, because collecting stacktraces is very expensive and largely useless for our purposes. Validatem's own error reporting is clear enough, and if not, that's a bug in Validatem anyway.
|
||||
function ValidationError(message, properties) {
|
||||
this.message = message;
|
||||
|
||||
module.exports = createError("ValidationError", {
|
||||
path: [],
|
||||
// NOTE: The below are for potential future compatibility logic.
|
||||
___validatem_isValidationError: true,
|
||||
___validatem_errorVersion: 1
|
||||
});
|
||||
Object.assign(this, {
|
||||
path: [],
|
||||
___validatem_isValidationError: true,
|
||||
___validatem_errorVersion: 1
|
||||
});
|
||||
|
||||
Object.assign(this, properties);
|
||||
}
|
||||
|
||||
ValidationError.prototype.name = "ValidationError";
|
||||
|
||||
module.exports = ValidationError;
|
||||
module.exports.__modulePath = __dirname;
|
||||
|
@ -1,11 +1,8 @@
|
||||
{
|
||||
"name": "@validatem/error",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"main": "index.js",
|
||||
"repository": "http://git.cryto.net/validatem/error.git",
|
||||
"author": "Sven Slootweg <admin@cryto.net>",
|
||||
"license": "WTFPL OR CC0-1.0",
|
||||
"dependencies": {
|
||||
"create-error": "^0.3.1"
|
||||
}
|
||||
"license": "WTFPL OR CC0-1.0"
|
||||
}
|
||||
|
Loading…
Reference in New Issue