Skip to content

with move to feign-core 10.x.x, support capturing the request in Exception constructors #18

Open
@saintf

Description

@saintf

Feign core 10.X.X allows capturing the Request made from a Response - meaning that we can include the original request into an exception if required.

The requirement here is to detect if one of the parameters in the constructor for the exception is of type Request, and if so, put the original request into that field.

In a later iteration we can ask people want us to do more parsing (like only include request headers based on a @RequestHeaders tag or only the request body based on a @RequestBody tag) - though for now we expect handing over the Request itself is probably more than enough (would want to see usecases for anything further).

Hence - put simply - when an exception is defined as:

public class MyException {
   
   public MyException(Request request) {
      ...
   }
}

then the AnnotationErrorDecoder should inject the Request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions