From 711007a67ace78a5d87f08854dba4faba281d38e Mon Sep 17 00:00:00 2001 From: Alan Bridgeman Date: Tue, 24 Jun 2025 11:59:15 -0500 Subject: [PATCH] Forgot to change code in second spot (this is why DRY principal exists etc...) --- src/decorators/Page.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/decorators/Page.ts b/src/decorators/Page.ts index 4e1a94c..b6c3c6d 100644 --- a/src/decorators/Page.ts +++ b/src/decorators/Page.ts @@ -157,8 +157,14 @@ export function Page(title: string, page: string, extraScripts: (string | { scri } catch(error) { console.error('[Page Decorator] Error:', error); - next(error); - return; + 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); + } } } }