Trying explicitly throwing error to trigger catch clause
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 37s

This commit is contained in:
Alan Bridgeman 2025-06-24 14:46:26 -05:00
parent 116f0a9446
commit 21469c647a

View file

@ -78,13 +78,13 @@ export function Controller<T extends { new (...args: any[]): BaseController }>()
const path = Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method); const path = Reflect.getMetadata(GET_METADATA_KEY, target.prototype, method);
// Bind the method to the class instance // Bind the method to the class instance
app.get(path, (req, res, next) => { app.get(path, async (req, res, next) => {
console.log('[Controller.setup.<GET request>] Request:', req); console.log('[Controller.setup.<GET request>] Request:', req);
console.log('[Controller.setup.<GET request>] Response:', res); console.log('[Controller.setup.<GET request>] Response:', res);
console.log('[Controller.setup.<GET request>] Next:', next); console.log('[Controller.setup.<GET request>] Next:', next);
try { try {
Promise.all([fn.bind(controller)(req, res, next)]) await Promise.all([fn.bind(controller)(req, res, next)])
.catch((error) => { throw new Error(error) }); .catch((error) => { throw new Error(error) });
} }
catch(error) { catch(error) {