diff options
Diffstat (limited to 'oxish-proto/src/channels.rs')
| -rw-r--r-- | oxish-proto/src/channels.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/oxish-proto/src/channels.rs b/oxish-proto/src/channels.rs index 9677ac2..917945d 100644 --- a/oxish-proto/src/channels.rs +++ b/oxish-proto/src/channels.rs @@ -244,12 +244,16 @@ impl<'a> TryFrom<IncomingPacket<'a>> for ChannelRequest<'a> { } b"[email protected]" => ChannelRequestType::AuthAgentReq, _ => { - match str::from_utf8(r#type) { - Ok(r#type) => warn!(%r#type, "unknown channel request type"), - Err(_) => warn!(?r#type, "unknown channel request type"), - } - - return Err(ProtoError::InvalidPacket("unknown channel request type")); + return Err(match str::from_utf8(r#type) { + Ok(r#type) => { + warn!(%r#type, "unknown channel request type"); + ProtoError::InvalidChannelType(r#type.to_owned()) + } + Err(_) => { + warn!(?r#type, "unknown channel request type"); + ProtoError::InvalidPacket("unknown channel request type (invalid UTF-8)") + } + }); } }; |
