[GH-ISSUE #68] Custom error messages from server. #58

Closed
opened 2026-02-28 01:22:58 +03:00 by kerem · 2 comments
Owner

Originally created by @olliebennett on GitHub (Dec 22, 2012).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/68

The server sends the following JSON response on failure:

{
    payload: {
        success: "false"
    }
}

When receiving this status, the app gives a notification along the lines of:

SMSSync message sending failed. Perhaps it's not configured or there is no Internet connection. Please double check your Internet connection or your configuration.

I propose that we allow an extra "error" field in the response, along the lines of:

{
    payload: {
        success: "false",
        error: "The supplied secret key was invalid."
    }
}

The only down-side is that error messages would have to be translated on the server, if required.

Examples server responses:

  • The unique ID was not specified.
  • The provided unique ID is not recognized.
  • The supplied secret key was invalid.
  • Your account has exceeded its quota for syncing.
  • Your account has been deactivated.
  • The server is experiencing issues. Please try again later.

Of course, a message similar to that currently shown, should still be shown in the case that the server is unreachable.

Originally created by @olliebennett on GitHub (Dec 22, 2012). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/68 The server sends the following JSON response on failure: ``` javascript { payload: { success: "false" } } ``` When receiving this status, the app gives a notification along the lines of: > SMSSync message sending failed. Perhaps it's not configured or there is no Internet connection. Please double check your Internet connection or your configuration. I propose that we allow an extra "error" field in the response, along the lines of: ``` javascript { payload: { success: "false", error: "The supplied secret key was invalid." } } ``` The only down-side is that error messages would have to be translated on the server, if required. Examples server responses: - The unique ID was not specified. - The provided unique ID is not recognized. - The supplied secret key was invalid. - Your account has exceeded its quota for syncing. - Your account has been deactivated. - The server is experiencing issues. Please try again later. Of course, a message similar to that currently shown, should still be shown in the case that the server is unreachable.
kerem closed this issue 2026-02-28 01:22:59 +03:00
Author
Owner

@eyedol commented on GitHub (Feb 11, 2013):

If there is a error value add that to notification message otherwise use the default message.

<!-- gh-comment-id:13400594 --> @eyedol commented on GitHub (Feb 11, 2013): If there is a `error` value add that to notification message otherwise use the default message.
Author
Owner

@olliebennett commented on GitHub (Feb 28, 2013):

Implemented, pending more testing. See my feature-errorcodes branch.

<!-- gh-comment-id:14210258 --> @olliebennett commented on GitHub (Feb 28, 2013): Implemented, pending more testing. See my [feature-errorcodes](https://github.com/olliebennett/SMSSync/tree/feature-errorcodes) branch.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#58
No description provided.