Because for async contexts the
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 42s
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:
parent
ff5ba18eae
commit
203d0488e6
1 changed files with 9 additions and 2 deletions
|
|
@ -98,9 +98,16 @@ export function Page(title: string, page: string, extraScripts: (string | { scri
|
|||
}
|
||||
catch(error) {
|
||||
console.error('[Page Decorator] Error:', error);
|
||||
|
||||
if(typeof next !== 'undefined') {
|
||||
next(error);
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue