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

Check NetworkRequest#mDestroyed before each network request? #563

Open
stefan-niedermann opened this issue May 23, 2023 · 1 comment
Open

Comments

@stefan-niedermann
Copy link
Member

I recently ran into an issue while trying to make a network request on an NextcloudAPI instance, on which I called close() before.

Of course, it failed, but at an odd place, that I didn't expected (I think context was null at some place).

This made me wondering why we do check for NetworkRequest#mDestroyed when connecting, but not before each request. Wouldn't make it sense to add this check also at the beginning of AidlNetworkRequest#performNetworkRequestV2 and throw a more meaningful IllegalStateException or something alike?

cc @David-Development

@David-Development
Copy link
Member

Yes, that makes perfect sense to me. Would for sure improve error handling a lot (and make it easier for devs to find the error in case something goes wrong).

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

No branches or pull requests

2 participants