CometChatCallsException class

Exception class for CometChat Calls SDK errors. All errors in the SDK are returned as CometChatCallsException with:

  • code: A unique error code from ErrorCodeConstants
  • message: A human-readable error message
  • details: Additional details about the error

Requirements: 10.1, 10.2, 10.3, 10.4

Implemented types

Constructors

CometChatCallsException(String code, String? message, String? details)
CometChatCallsException.callSettingsNull()
Creates a CometChatCallsException for call settings null error.
factory
CometChatCallsException.callTokenNull()
Creates a CometChatCallsException for call token null error.
factory
CometChatCallsException.fromMap(dynamic map)
Creates a CometChatCallsException from a Map. The map should contain 'code', 'message', and 'details' keys.
factory
CometChatCallsException.jsonParseError([String? details])
Creates a CometChatCallsException for JSON parsing error.
factory
CometChatCallsException.loginInProgress()
Creates a CometChatCallsException for login in progress error.
factory
CometChatCallsException.logoutFailed()
Creates a CometChatCallsException for logout failure.
factory
CometChatCallsException.networkError([String? details])
Creates a CometChatCallsException for network error.
factory
CometChatCallsException.platformNotSupported()
Creates a CometChatCallsException for platform not supported error.
factory
CometChatCallsException.sdkNotInitialized()
Creates a CometChatCallsException for SDK not initialized error.
factory
CometChatCallsException.sessionNotActive()
Creates a CometChatCallsException for session not active error.
factory
CometChatCallsException.sessionSettingsNull()
Creates a CometChatCallsException for session settings null error.
factory
CometChatCallsException.userAuthTokenNull()
Creates a CometChatCallsException for user auth token null error.
factory
CometChatCallsException.wrapUnhandled(dynamic exception)
Wraps any exception in a CometChatCallsException with ERROR_UNHANDLED_EXCEPTION code. This ensures all unhandled exceptions are properly wrapped with consistent structure.
factory

Properties

code String
The error code identifying the type of error. This should be one of the constants from ErrorCodeConstants.
getter/setter pair
details String?
Additional details about the error, useful for debugging.
getter/setter pair
hasCompleteStructure bool
Checks if this exception has all required fields (code, message, details) non-null. This is useful for property-based testing to verify exception structure consistency.
no setter
hashCode int
The hash code for this object.
no setteroverride
isAuthenticationError bool
Returns true if this is an authentication error.
no setter
isInitializationError bool
Returns true if this is an initialization error.
no setter
isNetworkError bool
Returns true if this is a network error.
no setter
isSessionError bool
Returns true if this is a session error.
no setter
isUnhandledException bool
Returns true if this is an unhandled exception.
no setter
isValidationError bool
Returns true if this is a validation error.
no setter
message String?
A human-readable message describing the error.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts this exception to a Map.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override