Generic Message (GM)

ECn Categories > Non-informative Message (NIM) > Generic Message (GM)

The displayed messages ( where there is a connectivity issue) do not let the user know why the performed action/feature was not executed.

Amount of Issues App List
82 (A1) QKSMS, (A2) Wire, (A3) Surespot Encrypted Messenger, (A4) Galaxy Zoo, (A5) Fanfiction reader, (A6) PressureNet, (A8) iFixit, (A14) Wikimedia Commons, (A15) WordPress, (A16) GnuCash, (A18) FBReader, (A19) K-9 Mail, (A22) Hubble Gallery, (A23) Prey, (A24) Forecastie, (A25) Twidere para Twitter, (A27) AnkiDroid, (A28) Transportr, (A29) Ouroboros, (A30) Earth viewer, (A31) Open Weather, (A32) Cannonbal, (A33) OpenBikeSharing, (A34) c:geo, (A36) Stepik, (A38) Wake You In Music, (A39) Habitica, (A40) Openshop.io 1.0, (A41) Glucosio, (A42) Signal Private Messenger, (A43) Tasks: Astrid To-Do List Clone, (A45) Kontalk Messenger, (A49) PocketHub for GitHub

Examples

Surespot Encrypted Messenger

Category: Social
v 70
Scenario: To invite a surespot user without internet connection
This video shows an example of a generic message, at 6th second after the user enters its credentials, the application shows an error message that says "Could not invite friend, please try again later" letting user know that something went wrong, nevertheless the error message is not clear that the problem is due to a lack of connection.

The following code snippets show the classes and files that are involved in the generation of the previuos issue.

In order to see how this error is generated, we will start seing how the method that creates the request to send the invitation is managed. So in the following snippet we can see the “inviteFriend” method that is called when the button is clicked, in this method at line 1626 the request is made using the text typed in the inpout field. Nevertheless there is no validation of an existent connection so the request lands on a failure state where the error message is display at line 1630 using the “could_not_invite” string constant.

src/main/java/com/twofours/surespot/activities/MainActivity.java

    private void inviteFriend() {
        
        final String friend = mEtInvite.getText().toString();

        if (friend.length() > 0) {
            if (friend.equals(mUser)) {
                // TODO let them be friends with themselves?
                Utils.makeToast(this, getString(R.string.friend_self_error));
                return;
            }

            setHomeProgress(true);
1626.       NetworkManager.getNetworkController(this, mUser)
                .invite(friend, new MainThreadCallbackWrapper(new MainThreadCallbackWrapper.MainThreadCallback() {
                
                @Override
                public void onFailure(Call call, IOException e) {
                    SurespotLog.i(TAG, e, "inviteFriend error");
1630.               Utils.makeToast(MainActivity.this, getString(R.string.could_not_invite));
                }

Since all the strings are stored in “strings” file, we can see that the string with “could_not_invite” id has a value that doesn’t give enough information to the user to know the error is due to a lack of connection.

src/main/res/values/strings.xml

    <string name="could_not_invite">Could not invite friend, please try again later.</string>