From 5f368cf125b65f1fdb3d43ec348435051f1e1f0e Mon Sep 17 00:00:00 2001 From: Rene Schallner Date: Sun, 21 Apr 2024 20:07:16 +0200 Subject: [PATCH] add doc comment to Request.sendError --- src/request.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/request.zig b/src/request.zig index 69c8a6c..1345379 100644 --- a/src/request.zig +++ b/src/request.zig @@ -317,8 +317,12 @@ pub fn getUserContext(self: *const Self, comptime Context: type) ?*Context { return null; } } - /// Tries to send an error stack trace. +/// Use like this: +/// ```zig +/// const err = zap.HttpError; // this is to show that `err` is an Error +/// r.sendError(err, if (@errorReturnTrace()) |t| t.* else null, 505); +/// ``` pub fn sendError(self: *const Self, err: anyerror, err_trace: ?std.builtin.StackTrace, errorcode_num: usize) void { // TODO: query accept headers if (self._internal_sendError(err, err_trace, errorcode_num)) {