{"record":{"id":"8179b335442d08f9","repo":"Pumpkin-MC/Pumpkin","slug":"texture-error-0","errorCode":null,"errorMessage":"Texture Error {0}","messagePattern":"Texture Error (.+?)","errorType":"exception","errorClass":"AuthError","httpStatus":null,"severity":"info","filePath":"crates/pumpkin/src/net/authentication.rs","lineNumber":401,"sourceCode":"\n    if not_found_count > 0 {\n        Ok(None)\n    } else if let Some(status) = last_unknown_status {\n        Err(AuthError::UnknownStatusCode(status))\n    } else {\n        Err(AuthError::FailedResponse)\n    }\n}\n\n#[derive(Error, Debug)]\npub enum AuthError {\n    #[error(\"Authentication servers are down\")]\n    FailedResponse,\n    #[error(\"Failed to verify username\")]\n    UnverifiedUsername,\n    #[error(\"You are banned from Authentication servers\")]\n    Banned,\n    #[error(\"Texture Error {0}\")]\n    TextureError(TextureError),\n    #[error(\"You have disallowed actions from Authentication servers\")]\n    DisallowedAction,\n    #[error(\"Failed to parse JSON into Game Profile\")]\n    FailedParse,\n    #[error(\"Unknown Status Code {0}\")]\n    UnknownStatusCode(StatusCode),\n}\n\n#[derive(Error, Debug)]\npub enum TextureError {\n    #[error(\"Invalid URL\")]\n    InvalidURL,\n    #[error(\"Invalid URL scheme for player texture: {0}\")]\n    DisallowedUrlScheme(String),\n    #[error(\"Invalid URL domain for player texture: {0}\")]\n    DisallowedUrlDomain(String),\n    #[error(\"Failed to decode base64 player texture: {0}\")]","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/authentication.rs#L383-L419","documentation":"PacketDecodeError::ConnectionClosed is raised when the connection is closed while a packet read/decode is in progress. The library surfaces this instead of treating a closed socket as a decode failure, letting callers distinguish normal disconnects from protocol errors. It typically means the peer (or network) ended the stream.","triggerScenarios":"A read on the packet stream returns end-of-file while the decoder is waiting for a packet length or body; the client disconnects between or during packet reads.","commonSituations":"Players quitting the game (normal client disconnect); client crash or network drop; idle timeouts on proxies closing the TCP connection.","solutions":["Treat this as a normal disconnect: clean up player/session state and stop reading from the connection.","Distinguish it from real decode errors in logging (log at info/debug, not error).","Ensure no further reads are attempted on the closed connection afterwards.","Add idle/keepalive handling (keep-alive packets) to detect and manage dead connections gracefully."],"exampleFix":"// before\nmatch decode_packet(stream).await {\n    Err(e) => error!(\"decode failed: {}\", e), // treats normal disconnect as error\n    Ok(p) => handle(p),\n}\n// after\nmatch decode_packet(stream).await {\n    Err(PacketDecodeError::ConnectionClosed) => info!(\"client disconnected\"),\n    Err(e) => warn!(\"decode failed: {}\", e),\n    Ok(p) => handle(p),\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match decode_packet(stream).await {\n    Err(PacketDecodeError::ConnectionClosed) => {\n        info!(\"connection closed by peer\");\n        cleanup_session();\n    }\n    Ok(p) => handle(p),\n    Err(e) => warn!(\"decode error: {e}\"),\n}","preventionTips":["Always handle ConnectionClosed separately from decode errors (it is a normal event).","Stop reading after the connection is closed.","Use keep-alive packets to distinguish idle peers from dead connections.","Clean up player/session state when this error occurs."],"tags":["protocol","connection","disconnect","network"],"backgroundTag":"connection-refused","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}