Added more stuff for debugging to figure out what is happening
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 30s

This commit is contained in:
Alan Bridgeman 2025-06-24 13:37:18 -05:00
parent d518bfea25
commit b357cf3f8f
2 changed files with 8 additions and 0 deletions

View file

@ -87,11 +87,15 @@ export function Controller<T extends { new (...args: any[]): BaseController }>()
return await fn.bind(controller)(req, res, next);
}
catch(error) {
console.log('[Controller.setup.<GET request>] Error:', error);
if(typeof next !== 'undefined') {
console.log('[Controller.setup.<GET request>] Calling next with error:', error);
next(error);
return;
}
else {
console.log('[Controller.setup.<GET request>] No next function defined, rejecting promise with error:', error);
// Because next is undefined and we still want to have Express handle the error we reject the promise
return Promise.reject(error);
}