From 3e09b05468c372e85518ff76d8d6d9a415f61fac Mon Sep 17 00:00:00 2001
From: kon-foo <25391223+kon-foo@users.noreply.github.com>
Date: Mon, 19 Feb 2024 17:50:40 +0000
Subject: [PATCH] docs: add self-hosting section (#883)

---
 quartz/util/trace.ts |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/quartz/util/trace.ts b/quartz/util/trace.ts
index c7f3cc3..a33135d 100644
--- a/quartz/util/trace.ts
+++ b/quartz/util/trace.ts
@@ -4,7 +4,7 @@
 
 const rootFile = /.*at file:/
 export function trace(msg: string, err: Error) {
-  const stack = err.stack
+  let stack = err.stack ?? ""
 
   const lines: string[] = []
 
@@ -12,15 +12,11 @@
   lines.push(
     "\n" +
       chalk.bgRed.black.bold(" ERROR ") +
-      "\n" +
+      "\n\n" +
       chalk.red(` ${msg}`) +
       (err.message.length > 0 ? `: ${err.message}` : ""),
   )
 
-  if (!stack) {
-    return
-  }
-
   let reachedEndOfLegibleTrace = false
   for (const line of stack.split("\n").slice(1)) {
     if (reachedEndOfLegibleTrace) {

--
Gitblit v1.10.0