Skip to content

Commit dd1e731

Browse files
committed
Fix error display
1 parent 420cfde commit dd1e731

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

websocket-base/src/result.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ pub enum WebSocketError {
4141

4242
impl fmt::Display for WebSocketError {
4343
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
44-
fmt.write_str("WebSocketError: ")?;
45-
fmt.write_str(self.description())?;
44+
match self {
45+
WebSocketError::Other(x) => x.fmt(fmt)?,
46+
_ => {
47+
fmt.write_str("WebSocketError: ")?;
48+
fmt.write_str(self.description())?;
49+
}
50+
}
4651
Ok(())
4752
}
4853
}

0 commit comments

Comments
 (0)