Skip to content

Server errors

Andrey Kadochnikov edited this page Feb 20, 2017 · 17 revisions

The MobileMessaging SDK provides an MobileMessagingError representation for the server error data. The following example demonstrates how an error code and a message attributes may be retrieved from the error object:

UserData userData = new UserData();
userData.setMsisdn("_&*70318xxxxx3");
MobileMessaging.getInstance(this).syncUserData(userData, new MobileMessaging.ResultListener<UserData>() {
    @Override
    public void onResult(UserData result) {
        // user data saved
    }
    @Override
    public void onError(MobileMessagingError e) {
        System.out.printf(e.getCode()); // should print "5"
        System.out.printf(e.getMessage()); // should print "Invalid MSISDN format [10005]"
    }
});

The following table represents the info about all possible server errors:

Error id Error text Description
0 Something went wrong [10000] This is really unknown, and most likely we are already working to fix things
1 Invalid Application Id [10001] The application code you provided to the SDK doesn't exists
3 Invalid email format [10003] The user's email that you provided to the SDK has invalid format
5 Invalid MSISDN format [10005] The user's MSISDN that you provided to the SDK has invalid format
9 Failed to sync user data [10009] The user data that you provided to the SDK has invalid format. More info about User Data
2, 4, 7, 8, 10, 11, 12, 13 Internal service error [xxxxx] There is nothing you can do with these errors, except retrying later
Clone this wiki locally