You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HttpApiSchemaError is reported as a failure though it answers 400 #8696
HttpApiSchemaError responds with 400 Bad Request, but unlike the other client errors in effect/http-api/HttpApiError (BadRequest, NotFound, Unauthorized, ...) it does not set [ErrorReporter.ignore] = true. Error reporters therefore treat every request that fails schema validation as a server-side failure.
In practice this floods logs: a host that logs unreported causes (Alchemy's Cloudflare Workers adapter, alchemy/src/Http.ts, logs "HTTP handler failed" at error level for any cause not marked ignored) prints a full error for each malformed request, even though the client simply sent bad input and received the documented 400.
// [email protected], packages/effect/src/http-api/HttpApiError.ts (also on main, 5e6f7568a4)exportclassHttpApiSchemaErrorextendsData.TaggedClass("HttpApiSchemaError")<{ ... }>{// no [ErrorReporter.ignore] = true, while BadRequest/NotFound/... declare it[HttpServerRespondable.symbol](){returnEffect.succeed(badRequestResponse)}}
Reproduce: serve an HttpApi endpoint with a payload schema, POST an invalid body, and observe the 400 response alongside an error report for the same request.
Suggested fix: add readonly [ErrorReporter.ignore] = true to HttpApiSchemaError, matching the other 4xx error classes.
Activity