HatangException

class HatangException(val code: String, val message: String, val status: Int? = null, cause: Throwable? = null) : Exception

An error reported by the Hatang gateway (REST or socket) or by the SDK itself.

code is the stable slug the gateway uses (invalid_app_key, rate_limit_exceeded, validation_error, ...). SDK-side failures use network_error, timeout, closed and decode_error. message is English and meant for logs; the UI translates code instead.

Constructors

Link copied to clipboard
constructor(code: String, message: String, status: Int? = null, cause: Throwable? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard

Stable error slug.

Link copied to clipboard

The app key is missing, wrong or revoked: no retry will help.

Link copied to clipboard

The gateway asked the client to slow down.

Link copied to clipboard

The visitor token is no longer accepted (reset elsewhere, revoked).

Link copied to clipboard

Worth retrying later (transport trouble, rate limits, server errors).

Link copied to clipboard
open override val message: String
Link copied to clipboard
val status: Int? = null

HTTP status when the error came from a REST call.

Functions

Link copied to clipboard
open override fun toString(): String