From e21f0f9bb97cbc4bd59f6bce0e0fce451b6d2b01 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 09 Aug 2023 04:28:09 +0000
Subject: [PATCH] change reading time to content meta
---
quartz/trace.ts | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/quartz/trace.ts b/quartz/trace.ts
index 47f9638..337ffe0 100644
--- a/quartz/trace.ts
+++ b/quartz/trace.ts
@@ -1,16 +1,23 @@
import chalk from "chalk"
+import process from "process"
const rootFile = /.*at file:/
export function trace(msg: string, err: Error) {
const stack = err.stack
console.log()
- console.log(chalk.bgRed.white.bold(" ERROR ") + chalk.red(` ${msg}`) + (err.message.length > 0 ? `: ${err.message}` : ""))
+ console.log(
+ "\n" +
+ chalk.bgRed.black.bold(" ERROR ") +
+ "\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)) {
+ for (const line of stack.split("\n").slice(1)) {
if (reachedEndOfLegibleTrace) {
break
}
@@ -22,4 +29,5 @@
}
}
}
+ process.exit(1)
}
--
Gitblit v1.10.0