Closed anqit closed 2 months ago
outCodecError
let you set a codec to transform the thrown errors into custom responses.
The default implementation is here
If what this interface does not offer what you need/want, please open another issue with your exact requirements. Docs on this will follow soon 🙂
Is there an example of how to use this for something like the case I mentioned above? Having some trouble grokking targeting specific errors with outCodecError
Unparseable inputs will result in a HttpCodecError.MalformedBody
Is your feature request related to a problem? Please describe. I'd like hooks in the
Endpoint
API to be able to customize error responses resulting for codec failures, rather than having to rely on the default response.Describe the solution you'd like With an endpoint defined as, for example,
Endpoint(..route...).in[User]...
, if the request doesn't provide a parseableUser
, I'd like to be able to customize the response returned in this case easily via a method provided by the Endpoint's fluent API.Describe alternatives you've considered I tried creating a custom codec mapping the ZIOs returned by
HttpContentCodec
, butdecodeRequest/Response
return aTask
, so there's not much room to customize the error there.