From 0dd6aa47ea149e949c72646ba916e5723850da44 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 24 Oct 2025 14:14:15 -0700 Subject: [PATCH] Replace panic with debug warn Closes https://github.com/oven-sh/bun/pull/24025 --- src/env_var.zig | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/env_var.zig b/src/env_var.zig index 99b35005f3..49d034f755 100644 --- a/src/env_var.zig +++ b/src/env_var.zig @@ -342,8 +342,8 @@ const kind = struct { deser: struct { /// Control how deserializing and deserialization errors are handled. error_handling: enum { - /// panic on deserialization errors. - panic, + /// debug_warn on deserialization errors. + debug_warn, /// Ignore deserialization errors and treat the variable as not set. not_set, /// Fallback to default. @@ -356,7 +356,7 @@ const kind = struct { /// Note: Most values are considered truthy, except for "", "0", "false", "no", /// and "off". truthy_cast, - } = .panic, + } = .debug_warn, /// Control what empty strings are treated as. empty_string_as: union(enum) { @@ -444,8 +444,10 @@ const kind = struct { "fallback to default on {s}, but no default is set."; switch (ip.opts.deser.error_handling) { - .panic => { - bun.Output.panic(fmt, .{ ip.var_name, raw_env }); + .debug_warn => { + bun.Output.debugWarn(fmt, .{ ip.var_name, raw_env }); + self.value.store(not_set_sentinel, .monotonic); + return null; }, .not_set => { self.value.store(not_set_sentinel, .monotonic);