+/// An error returned by the RPC server.
+#[derive(Debug)]
+pub struct RpcError {
+ /// The error code.
+ pub code: i64,
+ /// The error message.
+ pub message: String,
+}
+
+impl fmt::Display for RpcError {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "RPC error {}: {}", self.code, self.message)
+ }
+}
+
+impl Error for RpcError {}
+