RpcError

data class RpcError(val code: Int, val message: String, val data: String = "") : Exception

Specialized error handling for RPC methods.

Instances of this type, when thrown in a RPC method handler, will have their message serialized and sent across the wire. The sender will receive an equivalent error on the other side.

Built-in types are included but developers may use any message string, with a max length of 256 bytes.

Constructors

Link copied to clipboard
constructor(code: Int, message: String, data: String = "")

Types

Link copied to clipboard
object Companion

Properties

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

The error code of the RPC call. Error codes 1001-1999 are reserved for built-in errors.

Link copied to clipboard

An optional data payload. Must be smaller than 15KB in size, or else will be truncated.

Link copied to clipboard
open override val message: String

A message to include. Strings over 256 bytes will be truncated.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun toProto(): <Error class: unknown class>