Pumpkin-MC/Pumpkin · error · PacketDecodeError
{0}
Error message
{0} What it means
Catch-all variant of PacketDecodeError whose message is entirely supplied by the wrapped inner error ({0}). It is used to surface arbitrary lower-level decoding failures (e.g. io errors or specific field decode failures) through this enum; the meaning is that of the embedded error string, so inspect the inner value to diagnose the actual fault.
Solutions
- Inspect the embedded message to identify the failing decode step
- Log it at debug level with connection context
- Disconnect if the stream cannot be resynchronized
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at crates/pumpkin-protocol/src/lib.rs:315 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09).
Data as JSON: /api/errors/536d974f707458b1.
Report an issue: GitHub.
Appendix: source
Thrown at crates/pumpkin-protocol/src/lib.rs:315
}
#[derive(Error, Debug)]
pub enum PacketDecodeError {
#[error("failed to decode packet ID")]
DecodeID,
#[error("packet exceeds maximum length")]
TooLong,
#[error("packet length is out of bounds")]
OutOfBounds,
#[error("malformed packet length VarInt: {0}")]
MalformedLength(String),
#[error("failed to decompress packet: {0}")]
FailedDecompression(String), // Updated to include error details
#[error("packet is uncompressed but greater than the threshold")]
NotCompressed,
#[error("the connection has closed")]
ConnectionClosed,
#[error("{0}")]
Message(String),
}
impl From<ReadingError> for PacketDecodeError {
fn from(value: ReadingError) -> Self {
Self::FailedDecompression(value.to_string())
}
}
#[derive(Clone, serde::Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StatusResponse {
/// The version on which the server is running. (Optional)
pub version: Option<Version>,
/// Information about currently connected players. (Optional)
pub players: Option<Players>,
/// The description displayed, also called MOTD (Message of the Day). (Optional)
pub description: TextComponent,View on GitHub (pinned to 8d4639e25a)