diff --git a/dist/functions/server/web-pages/handle-web-pages.js b/dist/functions/server/web-pages/handle-web-pages.js index cb1da75..fb25aad 100644 --- a/dist/functions/server/web-pages/handle-web-pages.js +++ b/dist/functions/server/web-pages/handle-web-pages.js @@ -28,7 +28,7 @@ export default async function handleWebPages({ req, }) { }); } catch (error) { - log.error(`Error Handling Web Page: ${error.message}`); + log.error(`Error Handling Web Page: ${error.message}`, error); const componentRes = await grabPageErrorComponent({ error, }); diff --git a/dist/index.d.ts b/dist/index.d.ts index 07d2dd0..7dc0b3b 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -5,7 +5,7 @@ declare const bunext: { bunextLog: { info: (msg: string, log?: any) => void; success: (msg: string, log?: any) => void; - error: (msg: string | Error) => void; + error: (msg: string | Error, log?: any) => void; warn: (msg: string) => void; build: (msg: string) => void; watch: (msg: string) => void; diff --git a/dist/utils/log.d.ts b/dist/utils/log.d.ts index b9c9584..5794a63 100644 --- a/dist/utils/log.d.ts +++ b/dist/utils/log.d.ts @@ -1,7 +1,7 @@ export declare const log: { info: (msg: string, log?: any) => void; success: (msg: string, log?: any) => void; - error: (msg: string | Error) => void; + error: (msg: string | Error, log?: any) => void; warn: (msg: string) => void; build: (msg: string) => void; watch: (msg: string) => void; diff --git a/dist/utils/log.js b/dist/utils/log.js index 450a4ac..cd038e9 100644 --- a/dist/utils/log.js +++ b/dist/utils/log.js @@ -15,7 +15,7 @@ export const log = { success: (msg, log) => { console.log(`${prefix.success} ${chalk.green(msg)}`, log || ""); }, - error: (msg) => console.error(`${prefix.error} ${chalk.red(String(msg))}`), + error: (msg, log) => console.error(`${prefix.error} ${chalk.red(String(msg))}`, log || ""), warn: (msg) => console.warn(`${prefix.warn} ${chalk.yellow(msg)}`), build: (msg) => console.log(`${prefix.build} ${chalk.magenta(msg)}`), watch: (msg) => console.log(`${prefix.watch} ${chalk.blue(msg)}`), diff --git a/package.json b/package.json index d354972..90b792c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@moduletrace/bunext", "module": "index.ts", "type": "module", - "version": "1.0.11", + "version": "1.0.12", "main": "dist/index.js", "types": "dist/index.d.ts", "exports": { diff --git a/src/functions/server/web-pages/handle-web-pages.tsx b/src/functions/server/web-pages/handle-web-pages.tsx index 953a3ad..9e9027a 100644 --- a/src/functions/server/web-pages/handle-web-pages.tsx +++ b/src/functions/server/web-pages/handle-web-pages.tsx @@ -39,7 +39,7 @@ export default async function handleWebPages({ ...componentRes, }); } catch (error: any) { - log.error(`Error Handling Web Page: ${error.message}`); + log.error(`Error Handling Web Page: ${error.message}`, error); const componentRes = await grabPageErrorComponent({ error, diff --git a/src/utils/log.ts b/src/utils/log.ts index 7a6bfe0..bc85367 100644 --- a/src/utils/log.ts +++ b/src/utils/log.ts @@ -17,8 +17,8 @@ export const log = { success: (msg: string, log?: any) => { console.log(`${prefix.success} ${chalk.green(msg)}`, log || ""); }, - error: (msg: string | Error) => - console.error(`${prefix.error} ${chalk.red(String(msg))}`), + error: (msg: string | Error, log?: any) => + console.error(`${prefix.error} ${chalk.red(String(msg))}`, log || ""), warn: (msg: string) => console.warn(`${prefix.warn} ${chalk.yellow(msg)}`), build: (msg: string) => console.log(`${prefix.build} ${chalk.magenta(msg)}`),