Skip to content

No codec to decode status 400 errors using superagent-wrapper+express-wrapper #165

Open
@jonball4

Description

@jonball4

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions