avoid output when processing 404
All checks were successful
Generic zig build / build (push) Successful in 4m21s
Generic zig build / publish-macos (push) Successful in 15s
Generic zig build / deploy (push) Successful in 21s

This commit is contained in:
Emil Lerch 2026-06-01 16:46:04 -07:00
parent b796a46699
commit d7a86cd639
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -395,7 +395,22 @@ pub const Client = struct {
// sees the mapped HttpError variant
// (`Unauthorized`, `RateLimited`, ...) and has no
// path back to the upstream's reason.
log.warn("http rejection body status={d} body={s}", .{ @intFromEnum(response.status), response.body });
//
// 404s are noisy in normal operation: callers
// routinely encounter "no data" 404s for symbols
// EDGAR doesn't track, money-market funds with no
// NPORT-P, ETFs with no shares-outstanding XBRL,
// etc. The body of a 404 is usually a generic
// "NoSuchKey" / "Not Found" XML/HTML page that
// tells the operator nothing actionable. Demote
// those to debug so the warn-level log stream
// stays focused on cases the operator can act on
// (auth, rate, server outages).
if (response.status == .not_found) {
log.debug("http rejection body status=404 body={s}", .{response.body});
} else {
log.warn("http rejection body status={d} body={s}", .{ @intFromEnum(response.status), response.body });
}
response.allocator.free(response.body);
if (response.etag) |e| response.allocator.free(e);
return switch (response.status) {