mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 06:23:45 +00:00
Improve ergonomics of try catch (and Function's tryCall)
It now returns a Caught struct which contains all information. The Caught struct can be logged directly, providing more consistent logs for caught errors.
This commit is contained in:
@@ -333,10 +333,10 @@ fn writeString(comptime format: Format, value: []const u8, writer: *std.Io.Write
|
||||
pub const LogFormatWriter = struct {
|
||||
writer: *std.Io.Writer,
|
||||
|
||||
pub fn write(self: LogFormatWriter, key: []const u8, value: []const u8) !void {
|
||||
pub fn write(self: LogFormatWriter, key: []const u8, value: anytype) !void {
|
||||
const writer = self.writer;
|
||||
try writer.print(" {s}=", .{key});
|
||||
try writeString(.logfmt, value, writer);
|
||||
try writeValue(.logfmt, value, writer);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user