Skip to content

Commit

Permalink
chore: update error to include the value
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice committed Nov 6, 2024
1 parent f45fdd9 commit 4e183ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/basic.zig
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ export fn http_get() i32 {
plugin.setError("request failed");
return @as(i32, res.status);
}
var headers = res.headers(plugin.allocator) catch {
plugin.setError("failed to get headers from response!");
var headers = res.headers(plugin.allocator) catch |err| {
plugin.setErrorFmt("err: {any}, failed to get headers from response!", .{err}) catch unreachable;
return -1;
};
defer headers.deinit();
Expand Down

0 comments on commit 4e183ba

Please sign in to comment.