feat(relay): add debug logs when failing to parse input (#1851)

This commit is contained in:
Thomas Eizinger
2023-08-04 05:16:59 +02:00
committed by GitHub
parent b144ce0b83
commit 0c6d7f1c84

View File

@@ -229,10 +229,24 @@ where
self.queue_error_response(sender, error_code);
}
// Parsing the bytes failed.
Err(client_message::Error::BadChannelData(_)) => {}
Err(client_message::Error::DecodeStun(_)) => {}
Err(client_message::Error::UnknownMessageType(_)) => {}
Err(client_message::Error::Eof) => {}
Err(client_message::Error::BadChannelData(ref error)) => {
tracing::debug!(
error = error as &dyn std::error::Error,
"failed to decode channel data"
)
}
Err(client_message::Error::DecodeStun(ref error)) => {
tracing::debug!(
error = error as &dyn std::error::Error,
"failed to decode stun packet"
)
}
Err(client_message::Error::UnknownMessageType(t)) => {
tracing::debug!(r#type = %t, "unknown STUN message type")
}
Err(client_message::Error::Eof) => {
tracing::debug!("unexpected EOF while parsing message")
}
};
}