mirror of
https://github.com/zigzap/zap.git
synced 2025-10-20 23:24:09 +00:00
add doc comment to Request.sendError
This commit is contained in:
parent
d17436932d
commit
5f368cf125
1 changed files with 5 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue