mirror of
https://github.com/ushahidi/SMSSync.git
synced 2026-04-25 15:55:57 +03:00
[GH-ISSUE #69] Show user any erroneous HTTP response codes #60
Labels
No labels
Bug report
Code improvement
Concern
Feature request
Feature request
Good first issue to work on
In progress
Needs info
Question
Ready
Translation
User Experience
User Experience
Website
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SMSSync#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @olliebennett on GitHub (Dec 22, 2012).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/69
When the server sends any unsuccessful HTTP response code (such as 4XX Client Errors or 5XX Server Errors), the user is presented with the same generic error message as with any other problem:
This hinders debugging, and it would be much more useful to see an error such as:
Given that most users will be at least slightly technical, showing the actual response code from the server could at least allow them to google the issue.
As for what happens to 3XX (Redirect) status codes, I am not sure how these are/should be handled, but unless the redirect is automatically obeyed, these 'error' codes should also be shown to the user. Ideally, of course, a redirect should be followed, but that's another story.
@knedlsepp commented on GitHub (Jan 16, 2013):
That would be great. Took me ages to figure out that:
http://server/folder instead of http://server/folder/
would lead to a 301-move and thus SMSSync didn't forward correctly.
@eyedol commented on GitHub (Feb 11, 2013):
Related to #68
@olliebennett commented on GitHub (Feb 24, 2013):
What is the arrangement for translating strings with replaceable values? In this case, we need:
Error: Server returned HTTP status code {n}.which could use a simple text replacement in the code to add the number:
Error: Server returned HTTP status code 404.This is important for translations which wouldn't have the
404at the end:Fel: Servern returnerade HTTP {n} statuskod.Using the existing code, this doesn't seem possible without a bit of a refactoring of
Util.showToast()or similar methods.The other options:
org.apache.commons.httpclient.HttpStatus.getStatusText(int statusCode).Let's agree on what's best, and I'll implement it.
@eyedol commented on GitHub (Feb 25, 2013):
@olliebennett The Android translation framework supports replaceable values. So we can do
Error: server returned HTTP status code %dand it will dynamically change%dto the real value during runtime. That way we only have to translateError:server returned HTTP status code. Also the HTTP status codes are well documented@olliebennett commented on GitHub (Feb 28, 2013):
Thanks for that @eyedol - not sure how I missed the relevant section of the docs for formatting strings like that.
I've made some (relatively simple) changes, and pushed them to my feature-errorcodes branch.
I will make a pull request once I'm happy that they've been adequately tested.
@eyedol commented on GitHub (Mar 1, 2013):
Oh great!