ServerError

class ServerError(val statusCode: Int, message: String) : KHttpException(source)

Thrown on 5xx responses, or with statusCode = -1 for network-level failures (timeout, no connectivity, etc.).

KHttpConfig.onServerError is always invoked before this is thrown.

Parameters

statusCode

HTTP status code (500–599), or -1 for network errors.

message

Error detail parsed from the response body, or the exception message for network errors.

Constructors

Link copied to clipboard
constructor(statusCode: Int, message: String)

Properties

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