@exortek/fastify-mongo-sanitize
Version:
MongoDB query sanitizer for Fastify
19 lines (17 loc) • 483 B
JavaScript
/**
* Error class for FastifyMongoSanitize
*/
class FastifyMongoSanitizeError extends Error {
/**
* Creates a new FastifyMongoSanitizeError
* @param {string} message - Error message
* @param {string} [type='generic'] - Error type
*/
constructor(message, type = 'generic') {
super(message);
this.name = 'FastifyMongoSanitizeError';
this.type = type;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = FastifyMongoSanitizeError;