Fix a few comments

Switch generic http_client error level from warn to err
This commit is contained in:
Karl Seguin
2025-03-27 08:11:48 +08:00
parent afdb5d7233
commit 531a484cb0

View File

@@ -620,13 +620,13 @@ fn AsyncHandler(comptime H: type, comptime L: type) type {
// at this point, If `would_be_first == true`, then // at this point, If `would_be_first == true`, then
// `would_be_first` should be thought of as `is_first` because // `would_be_first` should be thought of as `is_first` because
// we now have a complete header for the first time.
if (reader.redirect()) |redirect| { if (reader.redirect()) |redirect| {
// We don't redirect until we've drained the body (because, // We don't redirect until we've drained the body (because,
// if we ever add keepalive, we'll re-use the connection). // if we ever add keepalive, we'll re-use the connection).
// Calling `reader.redirect()` over and over again might not // Calling `reader.redirect()` over and over again might not
// be the most efficient (it's a very simple function though), // be the most efficient (it's a very simple function though),
// but for a redirect resposne, chances are we slurped up // but for a redirect response, chances are we slurped up
// the header and body in a single go. // the header and body in a single go.
if (result.done == false) { if (result.done == false) {
return .need_more; return .need_more;
@@ -660,7 +660,7 @@ fn AsyncHandler(comptime H: type, comptime L: type) type {
} }
fn handleError(self: *Self, comptime msg: []const u8, err: anyerror) void { fn handleError(self: *Self, comptime msg: []const u8, err: anyerror) void {
log.warn(msg ++ ": {any} ({any} {any})", .{ err, self.request.method, self.request.uri }); log.err(msg ++ ": {any} ({any} {any})", .{ err, self.request.method, self.request.uri });
self.handler.onHttpResponse(err) catch {}; self.handler.onHttpResponse(err) catch {};
self.deinit(); self.deinit();
} }
@@ -807,7 +807,7 @@ fn AsyncHandler(comptime H: type, comptime L: type) type {
secure.state = .body; secure.state = .body;
const handler = self.handler; const handler = self.handler;
const body = handler.request.body orelse { const body = handler.request.body orelse {
// We've sent the haeder, and there's no body // We've sent the header, and there's no body
// start receiving the response // start receiving the response
handler.receive(); handler.receive();
return; return;