rosu_replay/
error.rs

1//! Error types for replay parsing and writing operations.
2
3use thiserror::Error;
4
5/// Errors that can occur when parsing or writing replay files.
6#[derive(Error, Debug)]
7pub enum ReplayError {
8    #[error("IO error: {0}")]
9    Io(#[from] std::io::Error),
10
11    #[error("LZMA decompression error: {0}")]
12    LzmaCustom(String),
13
14    #[error("UTF-8 conversion error: {0}")]
15    Utf8(#[from] std::string::FromUtf8Error),
16
17    #[error("String parsing error: {0}")]
18    Parse(String),
19
20    #[error("Invalid replay format: {0}")]
21    InvalidFormat(String),
22
23    #[error("Unexpected end of data")]
24    UnexpectedEof,
25
26    #[error("Invalid string byte: expected 0x00 or 0x0b, got {0:#x}")]
27    InvalidStringByte(u8),
28
29    #[error("LZMA decompression error: {0}")]
30    Lzma(#[from] liblzma::stream::Error),
31}