CXoneChatError
public enum CXoneChatError : LocalizedError, Equatable
The different types of errors that may be experienced.
-
The feature is not currently available for use.
This error indicates that a feature the SDK supports could not be used because the SDK has deliberately disabled it in the current release. The associated value carries the human-readable feature name so it can be surfaced in integrator-facing error messaging and logs.
- Source of problem: The feature is intentionally disabled in the current SDK version.
Attention
Wait for a new release of the SDK.Declaration
Swift
case featureUnavailable(String) -
The SDK version being used is no longer supported.
This error occurs when the SDK version is outdated and incompatible with the current API.
- Source of problem: Deprecated SDK version.
Attention
Please upgrade to the latest version of the SDK to ensure compatibility and access to all features.Declaration
Swift
case sdkVersionNotSupported -
The method being called is not supported with the current channel configuration.
Some features are available only with multithread channel configuration.
- Source of problem: SDK used incorrectly.
Attention
The channel is configured as a single-thread and called method requires a feature of multi-thread configuration, e.g.create().
Declaration
Swift
case unsupportedChannelConfig - Source of problem: SDK used incorrectly.
-
The conversion from object instance to data failed or when the Data object cannot be successfully converted to a valid UTF-8 string
SDK is converting an object, like
String, to theDataand vice versa and the conversion failed.- Source of problem: SDK/DFO issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case invalidData -
The provided ID for the thread was invalid, so the action could not be performed.
The SDK tried to find required thread but it does not exist or it is no more available.
- Source of problem: SDK used incorrectly
Attention
Check if thread exists and you are providing correct threadidwhich reffers tothreadIdOnExternalPlatform.Declaration
Swift
case invalidThread -
There aren’t any other messages, so additional messages could not be loaded.
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case noMoreMessages -
The provided attachment was unable to be sent.
CXone service does not receive any/all attachments.
- Source of problem: Unstable connection/SDK issue
Attention
Check if channel environment works correctly or gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case attachmentError -
The size of the attachment exceeds the allowed size
Channel
fileRestrictionsdefine allowed file size which can be received by the backend- Source of problem: SDK used incorrectly
Attention
Attachments should be validated for correct file size by the host applicationDeclaration
Swift
case invalidFileSize -
The type of the attachment is not included in the allowed file MIME type
Channel
fileRestrictionsdefine allowed file MIME types which can be received by the backned- Source of problem: SDK used incorrectly
Attention
Attachments should be validated for correct file type by the host applicationDeclaration
Swift
case invalidFileType -
The server experienced an internal error and was unable to perform the action.
SDK failed to upload attachment(s).
- Source of problem: Unstable connection/SDK issue
Attention
Check if channel environment works correctly or gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case serverError -
The parameter has not been set properly or it was unable to unwrap it as a required type.
The SDK tried to unwrap an object but it was missing. Could be internal object or data from the server.
- Source of problem: DFO issue/SDK issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case missingParameter(String) -
A invalid parameter has been passed to a method call.
This is one of:
send(_:)was called with no valid postback, empty text, and no attachments.
Declaration
Swift
case invalidParameter(String) -
The brand has configured pre-chat survey with contact custom fields which needs to be provided via
create(with:)method.- Source of problem: SDK used incorrectly
Attention
Fill-up custom fields available in thepreChatSurveyand pass them as a parameter in thecreate(with:)method.Declaration
Swift
case missingPreChatCustomFields -
A provided custom field does not have a definition in the case custom fields.
CXone service handles only those custom fields that are configured in the brand settings and others are ignored.
- Source of problem: SDK used incorrectly
Attention
Check the contact custom fields configured in your brand settings or the fields offered bypreChatSurvey.Declaration
Swift
case unknownCaseCustomFields -
A provided custom field does not have a definition in the customer custom fields.
CXone service handles only those custom fields that are configured in the brand settings and others are ignored.
- Source of problem: SDK used incorrectly
Attention
Check the customer custom fields configured in your brand settings.Declaration
Swift
case unknownCustomerCustomFields -
The SDK instance could not get customer identity possibly because it may not have been set.
Customer identity is necessary for binding threads to the visitor.
- Source of problem: SDK used incorrectly/SDK issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case customerAssociationFailure -
The SDK tried to send a transcript but something went wrong
- Source of problem: SDK used incorrectly/BE issue
Attention
Check if the feature is enabled viaisSendTranscriptEnabledand the provided e-mail is valid. Otherwise, gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case sendTranscriptFailed
-
The WebSocket refused to connect.
This error may occur within connection establishing process and it can relate to several issues - wrong IDs, an internet or CXone service connectivity issue or wrong connection URL.
- Source of problem: SDK used incorrectly/DFO issue
Attention
Check entered BrandID and ChannelID. If you are providing your own chatURL or socketURL, double check that these URLs are correct. Otherwise, Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case webSocketConnectionFailure -
The channel configuration could not be retrieved.
This error may occur with getting channel configuration and it can relate to several issues - wrong IDs or wrong connection URL.
- Source of problem: SDK used incorrectly
Attention
Check entered BrandID and ChannelID. If you are providing your own chatURL or socketURL, double check that these URLs are correct.Declaration
Swift
case channelConfigFailure -
The customer was successfully authorized, but an access token wasn’t returned.
The access token is used in case of OAuth authorization process.
- Source of problem: DFO issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case missingAccessToken -
The customer could not be associated with a visitor.
Some events, except customer identity, uses
visitorIdto match an user.- Source of problem: SDK issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case customerVisitorAssociationFailure -
The connection request was invalid and couldn’t be completed.
connect()may throw this error in case of incorrectly set socket endpoint object.- Source of problem: SDK used incorrectly/SDK issue
Attention
Check entered IDs and URLs. Otherwise, gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case invalidRequest -
Thread is missing the timestamp of when the message was created.
Every thread message contains timestamp to be able to identify latest message for loading previously created and not yet loaded messages via
loadMoreMessages()method.- Source of problem: DFO issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case invalidOldestDate -
An attached file could not be found.
It has been stored in an unknown location or its location is not accessible from the secure scope and it is not handled.
- Source of problem: SDK used incorrectly/SDK issue
Attention
Store your attachment in the secured scope or in the application documents directory. Otherwise, gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case noSuchFile(String) -
An analytics event has been generated when no visit was available.
Attention
viewPage(title:url:)must be called before any other analytics events are generatedDeclaration
Swift
case missingVisitId -
connect()or an analytics event has been generated when no visitor id was available.Attention
prepare(environment:brandId:channelId:)orprepare(chatURL:socketURL:loggerURL:brandId:channelId:tokenURL:)must be called beforeconnect()or any other analytics events are generated.Declaration
Swift
case missingVisitorId -
Unable to trigger the required method because the SDK is not in the required state.
The SDK has to be in correct state to trigger required operation. For example, connecting to the CXone service for chatting with an agent, it is firstly necessary to
prepare(environment:brandId:channelId:)channel configuration which leads to thepreparedstate and then it’s possible toconnect()to the websocket.Check
ChatStatefor more information.Source of problem
SDK used incorrectly
Declaration
Swift
case illegalChatState -
Unable to trigger the required method because the chat thread is not in the required state.
The chat thread has to be in correct state to trigger required operation. For example, to update thread name via
updateName(_:)the thread can not be inclosedstate.Check
ChatThreadStatefor more information.Source of problem
SDK used incorrectly
Declaration
Swift
case illegalThreadState -
Did not receive a paired response from the server in the expected time.
The SDK sent a request event to the server, but the server did not respond in the expected time.
- Source of problem: SDK issue, DFO issue
Attention
Gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case eventTimeout
-
The transaction token request failed.
This error occurs when the SDK is unable to obtain a transaction token from the server. The token is required for WebSocket authentication when using secured cookie or third-party OAuth authentication modes.
- Source of problem: Network issue/Server issue/SDK issue
Attention
Check network connectivity and ensure the channel is properly configured for transaction token authentication. Otherwise, gather any information about how the error was encountered and contact the CXoneChat SDK team.Declaration
Swift
case transactionTokenRequestFailed(statusCode: Int)Parameters
statusCodeThe HTTP status code returned by the server.
-
The provided access token is invalid.
This error occurs when the token supplied via
setConnectionToken(_:expiresAt:)is empty, expired, or rejected by the backend.- Source of problem: SDK used incorrectly / OAuth provider issue
Attention
Obtain a fresh token from your OAuth provider and supply it to the SDK.Declaration
Swift
case invalidAccessToken -
The session’s refresh token could not be used to recover the session automatically — it was rejected by the backend, was never stored, or the refresh grant returned no new access token.
This error occurs when a refresh-grant recovery attempt for the explicit OAuth flow cannot succeed and no further automatic recovery is possible.
Source of problem: OAuth provider issue / refresh token revoked or expired
Attention
The app owns re-authentication in this case — perform a new authorization-code (PKCE) grant to obtain a fresh access + refresh token pair, then supply it to the SDK.
Declaration
Swift
case invalidRefreshToken(String?)Parameters
messageThe backend’s own description of the rejection, when it supplied one. It is a fixed string tied to the backend’s error code rather than text from the OAuth provider, so it is useful for diagnostics and logging but should not be parsed or branched on.
nilwhen the session could not be recovered without the backend rejecting anything — no refresh token was stored, or a successful response arrived without a new access token.
-
Declaration
Swift
public var errorDescription: String? { get }
-
Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool
View on GitHub