-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Bug fix #1504 #1506
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
Bug fix #1504 #1506
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1506 +/- ##
=========================================
- Coverage 3.14% 3.14% -0.01%
=========================================
Files 136 136
Lines 7381 7387 +6
Branches 714 714
=========================================
Hits 232 232
- Misses 7134 7140 +6
Partials 15 15
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! IMO this should fix the bug. The issue was that exceptions were not being handled properly, thus leading to a crash.
Needs to be tested once on a real device.
@sivaraam Thanks for the update, will fix it it and update |
Hi @sivaraam I have made a fix for the same. I am not able to reproduce the same exception on my device. Can you please verify it now. |
if (throwable instanceof UnknownHostException || throwable instanceof ConnectException) { | ||
showErrorMessage(getString(R.string.slow_internet)); | ||
} else { | ||
showErrorMessage(throwable.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we should replace this with showErrorMessage(R.string.error_loading_nearby)
with error_loading_nearby
as string for "Error while loading Nearby locations that need images" or something similar. (I guess conveying the fact "... Nearby locations that need images" in the error would be informative part of the error though not related to the actual error that has occured ;-))
We could put throwable.getMessage()
where it's appropriate, the log. This way the exception isn't visible to the user.
Alternatively, we could try and find the possible exceptions that happen and provide a more user-friendly message for each exception. This should improve the user experience. Anyway, showing the exception message to the user would in no way be helpful to the non-technical users.
@ashishkumar468 I could check that but I don't think showing the message "You seem to have slow internet connection" would be appropriate in this case. That's because there was no internet connection at all. To be more precise technically the |
@sivaraam True, Lets put a generalised message, like you said, "Error while loading nearby locations". Later on we can figure out what all errors are possible for this scenario and may be include specific messages for such scenarios. Is everybody okay with this ? |
Sounds good to me. Having a generic message and the app not crashing would be great. @ashishkumar468 can you go ahead and make the changes. |
@maskaravivek Okay, will make the necessary changes and update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few fine points.
app/src/main/res/values/strings.xml
Outdated
@@ -282,7 +282,6 @@ | |||
|
|||
<string name="share_app_title">Share App</string> | |||
<string name="share_coordinates_not_present">Coordinates were not specified during image selection</string> | |||
<string name="something_went_wrong">Something went wrong</string> | |||
<string name="slow_internet">You seem to have slow internet connection</string> | |||
<string name="error_fetching_nearby_places">Error fetching nearby places.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing the message to "Error fetching nearby places that need images" thus mentioning what Nearby should actually be used for, as stated in my comment previously)? What Nearby should be used for isn't mentioned in a lot of places. So, it might be helpful to the user who see the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, If it's not mentioned at other places then just mentioning it in the error messages won't be that useful. After #706 this should be a bit more clear. :)
showErrorMessage(throwable.getMessage()); | ||
} | ||
Timber.d(throwable); | ||
showErrorMessage(getString(R.string.error_fetching_nearby_places)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a TODO: give meaningful error messages for each specific exception that might occur
here thus documenting the fact that this has to re-visited. It might even kindle people who accidentally see the TODO to work on it 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivaraam Am going ahead and merging this PR. Feel free to create a new issue for the above and fix it if possible. :)
Tested on a real device. The app didn't crash for me. Going ahead and merging it. |
I think you actually meant The app didn't crash for me., right? |
@sivaraam Yes. Typo! |
…rby (#1495) * Localisation updates from https://translatewiki.net. * Integrate API for displaying featured images (#1456) * Integrate API for displaying featured images * Add pagination and refactor code so that it can be reused for category images * Add license info to the images * Fix author view * Remove unused values * Fix minor issues with featured images * Fix null license url issue * Remove some log lines * Fix back navigation issue * fix tests * fix test inits * Gracefully handling various error situations * Added java docs * Update pull_request_template.md (#1476) * Update pull_request_template.md * Remove Javadocs mention * Added required/optional notes * resolves #1464 : MediaDataExtractor is making inefficient (redundant) server calls (#1496) * Open map of place where picture was taken (#1360) * Intent to map added * Merge conflicts resolved * Added the functionality to hide FAB incase of null coordinate * Merge Conflict resolved * Improve pr quality * Improve Quality * Added nested FAB animations * Nested FAB implemented * Improve Quality * Added up arrow * Javadocs Added * Add nearby tutorial (#1467) * Add dependency for MaterialShowcase * Add actionview class to get a reference to material showcase * Create a NearbyMaterialShowcaseSequence class * Apply sequence steps * Add first three steps of nearby showcase * Add sequence id constants to make sure they will be displayed only once * Add last step of sequence to explain plus fab * Create an object to prevent customize all sequences every time * Fix typo * Code cleanup * Add strings to strings.xml * Code cleanup * Revert irrelevant change * Revert irrelevant change * Remove showcaseview for recenter button * Use single showcaseView instead of sequence * Add single showcase view insted of sequence to be able to edit text style * Make sure it will be displayed only once * Cleanup * Update strings * Change dismiss text style * CONTRIBUTING: fix formatting of the gist of the guidelines (#1453) * CONTRIBUTING: fix formatting of the gist of the guidelines First level headings for a gist seems to be overkill. So, replace first level headings with an ordered-list which sounds more meaningful. * CONTRIBUTING: specify clearly that 'blame' is a feature of "Git" The contributing file specifies about the ability to know who wrote something without the need of @author javadoc tags but incorrectly attributes the feature to GitHub. Correctly attribute the feature to where it belongs, Git, and specify the name of the feature to help users easily take advantage of it. * Feature/switch to butterknife (#1494) * Implemented butterknife in MediaDetailFragment [issue #1491] * Implemented butterknife in MediaDetailPagerFragment [[issue #1491]] * post merge upstream master wip [[issue #1491]] * Localisation updates from https://translatewiki.net. * Bug fix #1504 (#1506) * Bug fix #1504 * Filtered messages with ConnectException [issue #1504] * A generalised message for exceptions in Nearby Activity [issue #1504] * Localisation updates from https://translatewiki.net. * Fix security exception crash while accessing network location provider (#1498) * Fix security exception crash while accessing network location provider * Added java docs * Localisation updates from https://translatewiki.net. * Log P18 edits to wikidata corresponding wikidata entity on uploading a nearby image * Added java docs * Fix test build * Refresh nearby * Refresh nearby list on successful edit * Java docs * Make authenticated wikidata edits * Updated toast message to show entity name that was edited
Description (required)
Fixes #{#1504}
{Subscribed to onError method in NearByActivity to handle exceptions at the source}
Tests performed (required)
Tested on {API level 21 & google x_86}, with {build variant, ProdDebug}.
Screenshots showing what changed (optional)
NA