Documentation Index Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
String uid = "UID" ;
String authKey = "AUTH_KEY" ;
// All errors are CometChatException objects
try {
User ? user = await CometChat . login (uid, authKey : authKey);
} on CometChatException catch (e) {
debugPrint (e.code); // e.g., "AUTH_ERR_AUTH_TOKEN_NOT_FOUND"
debugPrint (e.message); // Human-readable description
debugPrint (e.details); // Additional context (if available)
}
Error categories: Initialization, Login, Calling, Messages, Groups, Users, Conversations, Receipts, AI, Extensions
Every error thrown by the CometChat SDK is a CometChatException object with three properties:
Property Type Description codeStringMachine-readable error code messageString?Human-readable description detailsString?Additional context or troubleshooting info
try {
User ? user = await CometChat . login (authToken);
} on CometChatException catch (e) {
switch (e.code) {
case "AUTH_ERR_AUTH_TOKEN_NOT_FOUND" :
// Token is invalid or expired — prompt re-login
break ;
case "MISSING_PARAMETERS" :
// A required parameter was not provided
break ;
default :
debugPrint ( "Unexpected error: ${ e . message } " );
}
}
Initialization Errors
Code Message MISSING_PARAMETERSAppID cannot be empty. Please specify a valid appID.
Login & Authentication Errors
Code Message COMETCHAT_INITIALIZATION_NOT_DONEPlease initialize CometChat before using the login method. USER_NOT_AUTHORISEDThe authToken of the user is not authorised. Please verify again. AUTH_ERR_AUTH_TOKEN_NOT_FOUNDThe auth token does not exist. Please make sure you are logged in and have a valid auth token. LOGIN_IN_PROGRESSPlease wait until the previous login request ends. WS_CONNECTION_FAILWebSocket connection failed. WS_CONNECTION_FALLBACK_FAILWebSocket connection fallback failed. WS_AUTH_FAILWebSocket username/password not correct. NO_INTERNET_CONNECTIONYou do not have an internet connection. USER_NOT_LOGGED_INPlease log in to CometChat before calling this method.
Calling Errors
Code Message CALL_ALREADY_INITIATEDThere is already a call in progress. CALL_IN_PROGRESSThere is already a call in progress. NOT_INITIALIZEDPlease call CometChat.init() before calling any other methods. NOT_LOGGED_INPlease login before starting a call. SESSION_ID_REQUIREDPlease make sure you are passing a correct session ID. CALL_SETTINGS_REQUIREDPlease make sure you are passing the call settings object. JWT_NOT_FOUNDThere was an issue while fetching JWT from API.
Message Errors
Code Message INVALID_RECEIVER_TYPEReceiver type can be user or group. REQUEST_IN_PROGRESSRequest in progress. NOT_ENOUGH_PARAMETERSTimestamp, MessageId, or updatedAfter is required to use fetchNext(). INVALID_REASON_IDInvalid reasonId provided.
User Errors
Code Message INVALID_STATUS_VALUEThe status parameter accepts only online or offline. INVALID_DIRECTION_VALUEThe direction parameter accepts only both, blockedByMe, or hasBlockedMe. EMPTY_USERS_LISTThe users list needs to have at least one UID.
Group Errors
Code Message NOT_A_GROUPPlease use the Group class to construct a new group. INVALID_SCOPE_VALUEScope can be admin, moderator, or participant. INVALID_GROUP_TYPEGroup type can be public, private, protected, or password. ERR_EMPTY_GROUP_PASSPassword is mandatory to join a group.
Conversation Errors
Code Message INVALID_CONVERSATION_TYPEConversation type can be user or group. CONVERSATION_NOT_FOUNDConversation not found. Check the value of conversationWith and conversationType.
Receipt Errors
Code Message MISSING_PARAMETERSExpected 4 parameters, received 3. NO_WEBSOCKET_CONNECTIONConnection to WebSocket server is broken. Please retry after some time. RECEIPTS_TEMPORARILY_BLOCKEDDue to high load, receipts have been blocked for your app. UNKNOWN_ERROR_OCCURREDUnknown error occurred while marking a message as read.
AI Feature Errors
Code Message NO_CONVERSATION_STARTERUnable to get conversation starter for this conversation. NO_SMART_REPLYUnable to get smart reply for this conversation. NO_CONVERSATION_SUMMARYUnable to get summary of the conversation. EMPTY_RESPONSEUnable to get a suggestion. ERROR_INVALID_AI_FEATUREThe provided AI Feature cannot be null or empty.
Extension Errors
Code Message ERROR_INVALID_EXTENSIONThe provided extension cannot be null or empty. ERROR_EXTENSION_NOT_FOUNDThe provided extension could not be found.
Feature Restriction Errors
Code Message ERROR_INVALID_FEATUREThe provided feature cannot be null or empty. ERROR_FEATURE_NOT_FOUNDThe provided feature could not be found.
Notification Errors
Code Message INVALID_PUSH_PLATFORMAn invalid Push Platform was detected. Please submit a valid push platform to proceed. INVALID_FCM_TOKENAn invalid FCM token was detected. Please submit a valid token to proceed. INVALID_APNS_DEVICE_TOKENAn invalid APNs Device token was detected. Please submit a valid token to proceed. INVALID_APNS_VOIP_TOKENAn invalid APNs VoIP token was detected. Please submit a valid token to proceed.
Network & API Errors
Code Message FAILED_TO_FETCHThere is an unknown issue with the API request. Check your internet connection. TOO_MANY_REQUESTToo many requests. Wait before sending the next request. ERR_TOO_MANY_REQUESTSRate limiting. See Rate Limits .
Validation Errors
These errors use dynamic codes based on the parameter name (e.g., INVALID_UID, UID_IS_COMPULSORY):
Pattern Message INVALID_{param}The parameter should be a string / number / boolean / object / array. {param}_IS_COMPULSORYThe parameter cannot be blank. Please provide a valid value. {param}_NOT_PROVIDEDPlease provide the required parameter. ERROR_{param}_EXCEEDEDLimit exceeded max limit. INVALID_SEARCH_KEYWORDInvalid search keyword. Please provide a valid search keyword. MISSING_KEYThe key is missing from the object.
Prosody (WebSocket Server) Errors
Code Message ERROR_INVALID_SESSIONIDThe provided sessionId cannot be null or empty. ERROR_INVALID_TYPEThe provided type cannot be null or empty. ERROR_INVALID_GROUPLISTGrouplist cannot be null or empty.
General Errors
Code Message ERROR_IO_EXCEPTIONI/O exception occurred. ERROR_JSON_EXCEPTIONJSON parsing exception. ERROR_PASSWORD_MISSINGPassword is mandatory for a password group. ERROR_LIMIT_EXCEEDEDLimit exceeded max limit. ERROR_INVALID_GUIDPlease provide a valid GUID. ERR_SETTINGS_HASH_OUTDATEDSettings hash is outdated. ERR_NO_AUTHNo authentication credentials found.
Server-Side API Errors
For REST API error codes (returned by the CometChat backend), see the Error Guide . Common server-side errors you may encounter in SDK responses:
Code Description AUTH_ERR_EMPTY_APPIDEmpty App ID in headers AUTH_ERR_INVALID_APPIDInvalid App ID or does not exist in region ERR_UID_NOT_FOUNDUser does not exist or is soft deleted ERR_GUID_NOT_FOUNDGroup does not exist ERR_NOT_A_MEMBERUser is not a member of the group ERR_ALREADY_JOINEDUser has already joined the group ERR_MESSAGE_ID_NOT_FOUNDMessage does not exist ERR_PLAN_RESTRICTIONFeature not available with current plan ERR_TOO_MANY_REQUESTSRate limit exceeded
See the full list in the Error Guide .
Next Steps
Troubleshooting Common issues and solutions
Rate Limits Understand and handle rate limits
Error Guide (REST API) Complete server-side error code reference
Best Practices Recommended patterns for error handling