refit
refit copied to clipboard
[Bug]: How do we capture exceptions, which are not propagated through `RefitSettings.ExceptionFactory`?
Describe the bug 🐞
If exceptions occur during deserializing, they are not passed through RefitSettings.ExceptionFactory
.
For example, these:
https://github.com/reactiveui/refit/blob/4744780644ecaa5e23ee93fccbadd9528eaa6add/Refit/RequestBuilderImplementation.cs#L280
https://github.com/reactiveui/refit/blob/4744780644ecaa5e23ee93fccbadd9528eaa6add/Refit/RequestBuilderImplementation.cs#L298
Step to reproduce
- Replace
ExceptionFactory
inRefitSettings
with a custom factory; - Send a request that returns malformed JSON document;
- The exception will not be passed to your custom factory.
Reproduction repository
https://github.com/reactiveui/refit
Expected behavior
All exceptions should be passed through RefitSettings.ExceptionFactory
.
Currently we are forced to try/catch
every refit call, since these exceptions occur outside of message handlers.
Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows
Version
No response
Device
No response
Refit Version
7.0.0
Additional information ℹ️
No response