Skip to content

Silent failure when internet permission missing #714

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

Closed
tr4npt opened this issue Oct 14, 2014 · 3 comments
Closed

Silent failure when internet permission missing #714

tr4npt opened this issue Oct 14, 2014 · 3 comments
Assignees
Labels
Milestone

Comments

@tr4npt
Copy link

tr4npt commented Oct 14, 2014

If the app doesn't have internet permissions, the post() method never calls any of the callbacks (not even onFinished()) and does not log any error messages.

This issue occurs in the AsyncHttpRequest run() method:

    try {
        makeRequestWithRetries();
    } catch (IOException e) {

IOException should be changed to Exception to catch and report this error.

@smarek smarek added this to the 1.4.7 milestone Nov 14, 2014
@smarek smarek self-assigned this Nov 14, 2014
@smarek
Copy link
Member

smarek commented Nov 15, 2014

@tr4npt and what is the usecase? Library cannot be used without INTERNET permission, it's basic requirements to use it, so why should library report that? I don't see a point in that.

@tr4npt
Copy link
Author

tr4npt commented Nov 15, 2014

The point is that any OTHER exception is silently ignored and not reported. This is a simple change to make the library more robust.

Case 1:
IOException occurs -> client program is notified about the error

Case 2:
Any other exception occurs -> client program is not notified

I don't know what other exceptions are possible, but I sure would like to know when they occur. At the very least, the callback interface should be notified that the request is done. In case #2, this does not occur.

@smarek
Copy link
Member

smarek commented Apr 3, 2015

I just tried this, removing INTERNET permission from app that uses the library (both JAR and AAR), will receive IOException: Unhandled exception: Permission denied (missing INTERNET permission?)

Have you tried this using latest HEAD or with 1.4.6 ? If it exists as bug in 1.4.6 it is already fixed.

@smarek smarek closed this as completed Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants