Error Handling
Server Errors
Code | Error Name | Description |
400000 |
| Request contains invalid parameters. |
400001 |
| An invalid regex rule retrieved from or added to the Blocklist |
400002 |
| Video format not supported |
400100 |
| Unverified user performs any action that requires access token verification. |
400300 |
| User performs forbidden action such as uploading a pdf file in an image message. |
400301 |
| User has no permission to perform the action. |
400302 |
| A muted user sends a message. |
400303 |
| User sends a message in a muted channel. |
400304 |
| User accessed a channel or community where he is banned. |
400307 |
| User reached the limit of the number of sent messages containing blocklisted words. |
400308 |
| User sends a message that contains a blocklisted word. |
400309 |
| User sends a message that contains link that is not in the Allowlist. |
400311 |
| Web socket rate limit is exceeded. |
400312 |
| Banned user performs any action. |
400314 |
| Content moderation system detects unsafe content (eg. nudity). |
400315 |
| Display name of a collection already exists (eg. for your channels or community categories). |
400316 |
| Returned when unbanning a user that is not banned. |
400317 |
| The only active moderator in a channel/community attempts to leave and there are no other moderators in the group. |
400318 |
| The only moderator in a channel/community attempts to leave and there are no other members in the group. |
400319 |
| User changes module and user notification settings but the network notification setting is off. |
400400 |
| System cannot find any resource matched with the requested condition. |
400900 |
| System cannot create/update duplicated data. |
500000 |
| Uncategorized internal system errors not related to any user input. |
500000 |
| Video upload failed |
Client Errors
Code | Error Name | Description |
800000 |
| Uncategorized errors. To debug, refer to the 'error.message' property. |
800110 |
| Data type of the parameter is invalid. |
800210 |
| Websocket connection of the SDK cannot reach the platform server. This could also be the case if a user is global-banned and try to register a session. |
Error Objects
Error objects can be returned to you via LiveObjects, callbacks, or client error delegates. The possible error codes are listed in a public error code enum: each case is named after its error.
You can convert an Amity Exception into an Amity Error with the following:
All the errors returned by the iOS SDK come in form of an NSError
with domain Amity
.
For asynchronous errors, the client includes a clientErrorDelegate
property that can be set to an error handler delegate class on your application. This error delegate gives you a chance to be notified of errors that can potentially break the functionality of the SDK. The SDK logic is usually robust enough to automatically handle most errors, as such, only unrecoverable errors are exposed through this delegate (for example, if the login session was invalidated).
We recommend you to always handle these errors in a production app by gracefully disabling messaging functionality in the event of an error.
When an error is returned as a result of an action from your side (e.g. trying to join a channel), the action is considered completed and the SDK will not execute any additional logic.
Global ban error handling
A global ban error means that the user is banned from the system resulting in the inability to have a connection with the system. If the user already has a session, the session will be revoked and will be unable to create a new session.
Last updated