mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-01 12:27:43 +02:00
mzteinit: print ERT
This commit is contained in:
parent
21b6392a13
commit
5b4585e820
|
@ -42,6 +42,26 @@ pub fn main() void {
|
||||||
|
|
||||||
tryMain() catch |e| {
|
tryMain() catch |e| {
|
||||||
std.log.err("FATAL ERROR: {}", .{e});
|
std.log.err("FATAL ERROR: {}", .{e});
|
||||||
|
if (@errorReturnTrace()) |trace| {
|
||||||
|
var buf: [1024 * 8]u8 = undefined;
|
||||||
|
const trace_s = s: {
|
||||||
|
const deb_inf = std.debug.getSelfDebugInfo() catch break :s null;
|
||||||
|
|
||||||
|
var fbs = std.io.fixedBufferStream(&buf);
|
||||||
|
std.debug.writeStackTrace(
|
||||||
|
trace.*,
|
||||||
|
fbs.writer(),
|
||||||
|
std.heap.page_allocator,
|
||||||
|
deb_inf,
|
||||||
|
.no_color,
|
||||||
|
) catch break :s null;
|
||||||
|
break :s fbs.getWritten();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (trace_s) |s| {
|
||||||
|
std.log.err("ERT: {s}", .{s});
|
||||||
|
}
|
||||||
|
}
|
||||||
std.debug.print("Encountered fatal error (check log), starting emergency shell!\n", .{});
|
std.debug.print("Encountered fatal error (check log), starting emergency shell!\n", .{});
|
||||||
|
|
||||||
@panic(@errorName(std.os.execveZ(
|
@panic(@errorName(std.os.execveZ(
|
||||||
|
|
|
@ -7,4 +7,3 @@ pub fn Mutex(comptime T: type) type {
|
||||||
mtx: std.Thread.Mutex = .{},
|
mtx: std.Thread.Mutex = .{},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue