Handling Unit result in Converter #4390
Unanswered
lesbiangunshow
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Never mind my Response idea, turns out that under the hood it is a NoContentResponseBody so I'm not even free to grab it that way. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This behavior is tracked by #2867, and is hard to change without breaking things, unfortunately. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am working with a weird API that returns a 200 even when it has an error response. The error can usually be intercepted with a custom Converter that does logic on the response body. However, If we have a Unit return type then the response converter (sensibly?) is not invoked even though it covers
Any
. That means I'm kind of at a loss about how to intercept this without creating a custom Call adapter of some kind, which I'd like to avoid if possible. Any ideas/workarounds?One idea is using Response as a return type and performing logic on the raw value, but this would mean a special case for Unit which I'd like to avoid if possible.
Beta Was this translation helpful? Give feedback.
All reactions