Skip to content

Server errors

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

The plain server error response looks as follows:

{
  "requestError": {
    "serviceException": {
      "messageId": "13",
      "text": "Internal service error [30002]"
    }
  }
}

The MobileMessaging SDK provides an NSError representation for the error data. The following example demonstrates how a messageId and a text attributes may be retrieved from the error object:

// Swift
MobileMessaging.currentUser?.save(msisdn: "_&*70318xxxxx3",
                              completion:
    { error in
        print(error.mm_errorText) // should print "Invalid MSISDN format [10005]"
        print(error.mm_errorId) // should print "5"
    }
)

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