avoid output when processing 404
This commit is contained in:
parent
b796a46699
commit
d7a86cd639
1 changed files with 16 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue