scuffle_rtmp/chunk/error.rs
1//! Error types for chunk processing.
2
3/// Errors that can occur when reading or writing chunks.
4#[derive(Debug, thiserror::Error)]
5pub enum ChunkReadError {
6 /// Missing previous chunk header.
7 #[error("missing previous chunk header: {0}")]
8 MissingPreviousChunkHeader(u32),
9 /// Too many partial chunks.
10 #[error("too many partial chunks")]
11 TooManyPartialChunks,
12 /// There are too many previous chunk headers stored in
13 /// memory. The client is probably trying to DoS us.
14 #[error("too many previous chunk headers")]
15 TooManyPreviousChunkHeaders,
16 #[error("partial chunk too large: {0}")]
17 /// The length of a single chunk is larger than the max partial chunk size.
18 /// The client is probably trying to DoS us.
19 PartialChunkTooLarge(usize),
20}