Skip to content

feature: Exceptions should be exceptional #844

@jstafford5380

Description

@jstafford5380

Is your feature request related to a problem? Please describe.

When error codes are encountered, Refit throws. While I could catch this and handle it, the cost of the throw has already been incurred.

Describe the solution you'd like

Provide a means to handle the response without the exception being thrown. This could also open a door for project that would like to handle different codes in different ways.

Describe alternatives you've considered

Describe suggestions on how to achieve the feature

Creating an extensible response pipeline could do it. If I could insert a handler that allows me to handle the response and short-circuit the exception, that should suffice. Following a similar pattern as ASP's exception filter pipeline would feel natural, I think.

Additional context

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