From 03a7ad6658924c9c839f145f3cee2ca970138680 Mon Sep 17 00:00:00 2001 From: "shoney.arickathil" Date: Sun, 30 Aug 2026 03:17:39 +0200 Subject: [PATCH] fix(porch-store): log a genuine pool_count trap, not just 503 silently - catch (e) nil could not distinguish a real store failure (e.g. a mod-by-zero from Pool { actors: [] }) from ordinary saturation - print_err the trap message before answering 503, matching the same fix in idempotent.wo's pool_begin catch Co-Authored-By: Claude Opus 5 (1M context) (cherry picked from commit c53ad583051abeeeb302301fc3d91073f0a15fcc) --- docs/examples/porch/middleware/limiter.wo | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/examples/porch/middleware/limiter.wo b/docs/examples/porch/middleware/limiter.wo index eda1c68..f397ba8 100644 --- a/docs/examples/porch/middleware/limiter.wo +++ b/docs/examples/porch/middleware/limiter.wo @@ -34,7 +34,10 @@ pub class Limiter { fn before(mut req: Req) -> ?Resp { let key = limiter_key(self, req); - let v = try pool_count(self.pool, key, self.limit, self.window) catch (e) nil; + let v = try pool_count(self.pool, key, self.limit, self.window) catch (e) { + print_err("limiter: pool_count trapped: ${e.msg}"); + nil + }; if v == nil { let r = Resp { status: 503, headers: {}, body: "{\"error\":\"rate limiter saturated\"}" };