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); return await fn.bind(controller)(req, res, next);
} }
catch(error) { catch(error) {
console.log('[Controller.setup.<GET request>] Error:', error);
if(typeof next !== 'undefined') { if(typeof next !== 'undefined') {
console.log('[Controller.setup.<GET request>] Calling next with error:', error);
next(error); next(error);
return; return;
} }
else { 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 // Because next is undefined and we still want to have Express handle the error we reject the promise
return Promise.reject(error); return Promise.reject(error);
} }

View file

@ -158,10 +158,14 @@ export function Page(title: string, page: string, extraScripts: (string | { scri
catch(error) { catch(error) {
console.error('[Page Decorator] Error:', error); console.error('[Page Decorator] Error:', error);
if(typeof next !== 'undefined') { if(typeof next !== 'undefined') {
console.log('[Page Decorator] Calling next with error:', error);
next(error); next(error);
return; return;
} }
else { else {
console.log('[Page Decorator] 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 // Because next is undefined and we still want to have Express handle the error we reject the promise
return Promise.reject(error); return Promise.reject(error);
} }