From 681b3f95141488cf8bd086b06a304c817bb5ba7a Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 1 Aug 2024 17:14:11 +0800 Subject: [PATCH] Enhance runtime error stack trace output for better debugging --- runtime/runtime.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/runtime.go b/runtime/runtime.go index d6013b9f..f092947a 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -12,6 +12,11 @@ import ( // Start v8 runtime func Start(cfg config.Config) error { + debug := false + if cfg.Mode == "development" { + debug = true + } + option := &v8.Option{ MinSize: cfg.Runtime.MinSize, MaxSize: cfg.Runtime.MaxSize, @@ -24,6 +29,7 @@ func Start(cfg config.Config) error { DefaultTimeout: cfg.Runtime.DefaultTimeout, ContextTimeout: cfg.Runtime.ContextTimeout, Import: cfg.Runtime.Import, + Debug: debug, } // Read the tsconfig.json