Skip to main content
Skip table of contents


If any error would occur you would get an ApiError object by Throwable.

ErrorType - shows common error information.

name - name of error.

message - information message sent from server.

statusCode - status code of the error in case the error was from server.

Error types

You should handle 419 and 422 request status codes by separating the authentication flow.

For example, how to handle login errors:

fun handleErrors() {
    if (throwable is HttpException) {
        when (throwable.code()) {
            419 -> {
                val response = getLoginResponse(error)
                if (response != null) {
                // In this case you have limited sessions and you should to remove one
                // to login with new session
                } else {
                    // your common handling error

            422 -> {
                if (throwable.isCaptchaNeeded()) {
                    // If has captcha error then you should to update your captcha
                } else {
                    // your common handling error

            else -> {
                // your common handling errors
    } else {
        // your common handling errors

About status codes and how you should handle it

401 - case Unauthorised, you should do logout user

403 - case Forbidden, when you didn't have permission to invoke request

409 - case Force Update, when you need to update version sdk

419 - case Session Expired, should remove some session to login

422 - case Incorrect Data, call getErrorMessage422(throwable: Throwable) to get text error

429 - case Request Limit, when too many requests occurred

503 - case Technical Error, you can show custom error message or screen

500 - case Server Error, you can show custom error message or screen

Unknown error - case unknown

No internet connection - case no connection

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.