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
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 30s
This commit is contained in:
parent
d518bfea25
commit
b357cf3f8f
2 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,10 +158,14 @@ export function Page(title: string, page: string, extraScripts: (string | { scri
|
|||
catch(error) {
|
||||
console.error('[Page Decorator] Error:', error);
|
||||
if(typeof next !== 'undefined') {
|
||||
console.log('[Page Decorator] Calling next with error:', error);
|
||||
|
||||
next(error);
|
||||
return;
|
||||
}
|
||||
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
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue