KsrpcException

open class KsrpcException(val code: Int, val message: String, val data: Any? = null, cause: Throwable? = null) : RuntimeException

Base class for exceptions thrown by the ksrpc runtime.

Carries an integer code classifying the error, a human-readable message for wire-format compatibility and fallback debugging, and an optional typed data payload. When a method declares @KsError bindings, the runtime deserializes the wire payload into the mapped @Serializable type and exposes it here; callers that handle a known error type down-cast data to inspect it, while callers without a typed mapping observe data == null and rely on code + message.

Subclasses may narrow the conventions (e.g. RpcException pins code = -1, RpcEndpointException pins code = -32601), and transports translate code into their native error envelope.

Inheritors

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
val code: Int
Link copied to clipboard
val data: Any?
Link copied to clipboard
open override val message: String