diff --git a/src/thespian.zig b/src/thespian.zig index 861a312..22255ac 100644 --- a/src/thespian.zig +++ b/src/thespian.zig @@ -252,6 +252,7 @@ pub fn exit_fmt(comptime fmt: anytype, args: anytype) result { } pub fn exit_error(e: anyerror, stack_trace: ?*std.builtin.StackTrace) error{Exit} { + if (stack_trace_on_errors and e == error.OutOfMemory) std.debug.panicExtra(stack_trace, null, "{any}", .{e}); return switch (e) { error.Exit => error.Exit, else => set_error_msg(exit_message(e, stack_trace)),