diff --git a/src/dtls_combine.rs b/src/dtls_combine.rs index e668f2b..c203acb 100644 --- a/src/dtls_combine.rs +++ b/src/dtls_combine.rs @@ -33,7 +33,7 @@ pub fn combine_dtls_fragments<'a>( } if fragments.len() > MAX_FRAGMENTS { - panic!("More than max fragments"); + return Err(Err::Error(make_error(&*out, ErrorKind::TooLarge))); } const MESSAGE_HEADER_OFFSET: usize = 12;