Creates an error object with the given code and message, plus an optional data payload.
If thrown in an RPC method handler, the error will be sent back to the caller.
Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings).
Optional
data: stringOptional
dataStatic
ErrorStatic
MAX_Static
MAX_
Specialized error handling for RPC methods.
Instances of this type, when thrown in a 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 string, with a max length of 256 bytes.