diff --git a/zyte_api/stats.py b/zyte_api/stats.py index f00f41c..f7f95e4 100644 --- a/zyte_api/stats.py +++ b/zyte_api/stats.py @@ -152,7 +152,7 @@ def record_exception(self, exception: Exception, agg_stats: AggStats) -> None: def record_request_error(self, error_body: bytes, agg_stats: AggStats) -> None: self.error = ParsedError.from_body(error_body) - if self.status == 429: # XXX: status must be set already! + if self.status == 429: agg_stats.n_429 += 1 else: agg_stats.n_errors += 1