NetworkException

open class NetworkException(message: String? = null, cause: Throwable? = null, val code: Int? = null, val body: String? = null) : Exception

Represents an exception that occurs during network operations in the Stellar SDK.

This exception is thrown in the following cases:

  • When the server returns a non-2xx status code

  • When the error field in the information returned by the server is not empty

  • When the required resources are not found on the server, such as when an account does not exist

  • When a request times out

  • When a request cannot be executed due to cancellation or connectivity problems, etc.

Inheritors

Constructors

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

Properties

Link copied to clipboard
val body: String?

The raw body of the response, or null if not available

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
val code: Int?

The HTTP status code of the response, or null if not applicable

Link copied to clipboard
expect open val message: String?