@ents24/be-sure
Version:
NPM module for terse, 'throwy' validation
12 lines (11 loc) • 346 B
JavaScript
/**
* Provide a specific error class so that consuming code can
* .. check whether a thrown error came from here
* Extend Error to ensure stack trace https://javascript.info/custom-errors
*/
export default class ValidationError extends Error {
constructor(message) {
super(message);
this.name = "ValidationError";
}
}