NRError
open class NRError @JvmOverloads constructor(var errorCode: String = GeneralError, var reason: String? = Unknown, var description: String? = null, var data: Any? = null)
Represents a failure that can occur during a chat session.
Errors are delivered through ChatEventListener.onError. Use errorCode to determine the type of failure and the appropriate recovery action in your application.
Handling errors:
override fun onError(error: NRError) {
when (error.errorCode) {
NRError.AuthorizationRequired -> {
// Re-authenticate and call ChatController.reauthorizeImplicitFlow.
}
NRError.AttachmentValidationError -> {
// Inform the user about file size/type restrictions.
}
NRError.ClientNotAuthenticatedError, NRError.AuthLogoutError -> {
// Return the user to the login screen.
}
else -> {
// Show a generic error message.
}
}
}Content copied to clipboard
Types
Link copied to clipboard
annotation class ErrorReason
Marks a String value as one of the error reason constants defined in the companion object.