Skip to content
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

Add global HTTP error callback method #8631

Open
WoKee opened this issue Dec 24, 2024 · 2 comments
Open

Add global HTTP error callback method #8631

WoKee opened this issue Dec 24, 2024 · 2 comments
Labels
enhancement Feature not a bug

Comments

@WoKee
Copy link

WoKee commented Dec 24, 2024

Requirement:
For Android, many third-party SDKs are integrated into the project development, and they also use OKHTTP internally. When there are some error message Toasts, users will give us feedback。

For example: Too many follow up requests: 21, HTTP 404, etc

Interceptor is designed for the new okhttpclient instance.

However, due to their internally initialized okhttpclient, we are unable to add an Interceptor or determine which SDK it belongs to based on Toast prompts. Therefore, there is a requirement for a global static error callback

Like RxJava:
RxJavaPlugins.setErrorHandler(throwable -> { });

Or is there currently a solution?

Thanks。

@WoKee WoKee added the enhancement Feature not a bug label Dec 24, 2024
@yschimke
Copy link
Collaborator

I share your pain. A similar issue

google-gemini/generative-ai-android#39

But I'm not sure we want to take this control away from SDK developers. Maybe it's a secure call and another library might snoop on those.

@WoKee
Copy link
Author

WoKee commented Dec 24, 2024

I share your pain. A similar issue

google-gemini/generative-ai-android#39

But I'm not sure we want to take this control away from SDK developers. Maybe it's a secure call and another library might snoop on those.

Yes, there may be some kind of concern.

It is reasonable to provide a unified callback to expose the content of the error and the host where the error occurred, without returning the complete request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature not a bug
Projects
None yet
Development

No branches or pull requests

2 participants