We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fed9cc6 commit 81a5de0Copy full SHA for 81a5de0
livekit/src/room/participant/rpc.rs
@@ -4,7 +4,7 @@
4
5
use crate::room::participant::ParticipantIdentity;
6
use livekit_protocol::RpcError as RpcError_Proto;
7
-use std::time::Duration;
+use std::{error::Error, fmt::Display, time::Duration};
8
9
/// Parameters for performing an RPC call
10
#[derive(Debug, Clone)]
@@ -84,6 +84,13 @@ impl RpcError {
84
}
85
86
87
+impl Display for RpcError {
88
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
89
+ write!(f, "RPC Error: {} ({})", self.message, self.code)
90
+ }
91
+}
92
+impl Error for RpcError {}
93
+
94
#[derive(Debug, Clone, Copy)]
95
pub enum RpcErrorCode {
96
ApplicationError = 1500,
0 commit comments