feat: panic with stacktrace on OutOfMemory errors when stack_trace_on_errors is set
This commit is contained in:
parent
b82d735579
commit
b10131ee52
1 changed files with 1 additions and 0 deletions
|
@ -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} {
|
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) {
|
return switch (e) {
|
||||||
error.Exit => error.Exit,
|
error.Exit => error.Exit,
|
||||||
else => set_error_msg(exit_message(e, stack_trace)),
|
else => set_error_msg(exit_message(e, stack_trace)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue