-
- All Implemented Interfaces:
-
java.io.Serializable
public final class RpcError extends 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumRpcError.BuiltinRpcErrorpublic classRpcError.Companion
-
Method Summary
Modifier and Type Method Description final IntegergetCode()The error code of the RPC call. StringgetMessage()A message to include. final StringgetData()An optional data payload. ThrowablegetCause()The local cause of the error, if any. final LivekitModels.RpcErrortoProto()-
Methods inherited from class java.lang.Exception
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getCode
final Integer getCode()
The error code of the RPC call. Error codes 1001-1999 are reserved for built-in errors.
See RpcError.BuiltinRpcError for built-in error information.
-
getMessage
String getMessage()
A message to include. Strings over 256 bytes will be truncated.
-
getData
final String getData()
An optional data payload. Must be smaller than 15KB in size, or else will be truncated.
-
getCause
Throwable getCause()
The local cause of the error, if any. This will not be passed over the wire to the remote.
-
toProto
final LivekitModels.RpcError toProto()
-
-
-
-