Description
When using superagent-wrapper
in conjunction with a service built on express-wrapper
, a 400 error sent by the express-wrapper
leads to superagent-wrapper
failing to decode (using decodeExpecting
) if there is no codec defined for a 400 error response.
It seems like we need a default error codec for the 400 status, because if the request is intercepted and rejected before the defined handler can get ahold of it, then the dev has no referential definition or control of the express-wrapper
defined error message coming from request decoding errors which cause 400s.
If the handler returns a 400 under certain circumstances, then that is under the dev's control and can be defined in the HttpRoute
definition, but it could potentially conflict with the error response type returned by the express-wrapper, so a default error codec is also not the best solution. I don't have a better suggestion right now, but will think about it...