refactor: rework error handling to simplifiy command implementation and provide better back traces
This commit is contained in:
parent
21b604f4d6
commit
032982c1e8
26 changed files with 821 additions and 785 deletions
|
@ -103,8 +103,8 @@ fn append(self: *Self, json: []const u8) !void {
|
|||
pub fn listen(self: *Self, _: tp.pid_ref, m: tp.message) tp.result {
|
||||
if (try m.match(.{ "M", tp.more })) return;
|
||||
var buf: [4096]u8 = undefined;
|
||||
const json = m.to_json(&buf) catch |e| return tp.exit_error(e);
|
||||
self.append(json) catch |e| return tp.exit_error(e);
|
||||
const json = m.to_json(&buf) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
self.append(json) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
|
||||
pub fn receive(_: *Self, _: tp.pid_ref, _: tp.message) error{Exit}!bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue