A network request is not being handled on failure
Dear Developer!
My name is Alejandro Mazuera-Rozo, I am a PhD Student at Universidad de los Andes, and at Università della Svizzera italiana. I am part of a research on the usage of network libraries within Android apps. As result of this we identified some code locations that might have network related problems.
In this case, we address the code locations that are related to a network request which is not being assessed on failure. In order to avoid misbehaviour when performing network operations it is recommended to handle failure scenarios.
In order to address these issues we recommend:
- To add a try statement allowing you to define a block of code to be assessed while being executed.
- To implement a catch statement in which one defines a block of code to be executed if an error occurs.
Potential Code Location not handling failure scenarios when performing a network request
There is no try statement handling the request:
https://github.com/jonasoreland/runnerup/blob/26ed618eec9bc2771c6931d346c8216e3c4e3d6c/app/src/main/org/runnerup/export/DropboxSynchronizer.java#L242
There is no catch implementation:
https://github.com/jonasoreland/runnerup/blob/26ed618eec9bc2771c6931d346c8216e3c4e3d6c/app/src/main/org/runnerup/export/RunKeeperSynchronizer.java#L470-L483
wioll look at this, thanks