Because for async contexts the
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 42s

ext function still seems to be undefined within the #Page decorator we just reject the Promise instead hoping this will tigger the proper express Error handling
This commit is contained in:
Alan Bridgeman 2025-06-24 11:42:01 -05:00
parent ff5ba18eae
commit 203d0488e6

View file

@ -98,9 +98,16 @@ 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') {
next(error); next(error);
return; return;
} }
else {
// Because next is undefined and we still want to have Express handle the error we reject the promise
return Promise.reject(error);
}
}
} }
} }
else { else {