New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a better error message when multiple callback types are in use. #827
Comments
Both returning the observable and the callback are mechanisms of how the request is executed. You don't need both, only one. In this case, Retrofit sees the observable as the way the request will be executed and treats all of the method parameters as part of how the request will be created. Since the callback parameter has no annotation, it thinks this is an error. Simply remove the callback or change the return type to I'll leave this issue open as a reminder to create a better error message for this case. |
But according to your logic, there is no way for me to parse the ResponseBody. AFAIK, I need a custom Callback for that. Am I wrong? |
Callback is a mechanism of notifying you of data just as the observable is. There is no way to receive both the |
Oh wait, I just had to do: |
@JakeWharton Thanks for the tip. Have some @changetip bitcoin $1 on me. |
Hi @JakeWharton, @IgorGanapolsky sent you a Bitcoin tip worth 4,251 bits ($1.00), and I'm here to deliver it ➔ collect your tip. |
This was fixed as a side-effect of the massive #845 change. The v2.0 release will have better messaging around erroneous usage of the execution mechanism. |
Could you tell me how it was resolve in v 2.0 ? |
Hello,
I am using retrofit 1.9.0, and getting a strange error:
I defined my api method like this:
@POST("/login") Observable<Customer> doEmailLogin(@Body LoginBody loginBody, Callback<ResponseBody> callback);
What could be causing this error with my Callback interface??
Thank you,
Igor
The text was updated successfully, but these errors were encountered: