pub fn to_rpc_error(code: i32, message: &str, data: Option<Value>) -> RpcError
Convert error to RPC error format