I am trying to identify the type of error thrown by this function:
validationResult(req).throw()
This is how the throw function is defined:
throw() {
if (!this.isEmpty()) {
throw Object.assign(new Error(), utils_1.bindAll(this));
}
}
Here is the utils_1.bindAll function for reference:
exports.bindAll = (object) => {
const protoKeys = Object.getOwnPropertyNames(Object.getPrototypeOf(object));
protoKeys.forEach(key => {
const maybeFn = object[key];
if (typeof maybeFn === 'function' && key !== 'constructor') {
object[key] = maybeFn.bind(object);
}
});
return object;
};
It appears that the throw() function does not specify a particular error type, but I need to figure it out in order to handle express-validator errors in a specific manner.