Skip to content

Allow to recover gracefully from error decoding #381

@bandrzejczak

Description

@bandrzejczak

Right now the only way you could handle response status >=300 is either via using Response class as a return type, or via throwing a custom exception from errorDecoder (https://github.com/Netflix/feign/blob/6a6271727ad14dd776e3c3fb029f15fdf95c9c4a/core/src/main/java/feign/SynchronousMethodHandler.java#L112-L135).
This prevents handling failed responses via spring ResponseEntity and generally prevents handling failures gracefully with errorDecoder.

If we would change throw to return in https://github.com/Netflix/feign/blob/6a6271727ad14dd776e3c3fb029f15fdf95c9c4a/core/src/main/java/feign/SynchronousMethodHandler.java#L134, we could both return custom error object if needed, and throw an exception if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions