    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33

    use memflow::types::Address;
    use thiserror::Error;

    use crate::structs::Vec3;

    #[derive(Error, Debug)]
    pub enum Error {
        /// Game version mismatch.
        /// First arg is the game version, second is the offset version.
        #[error("version mismatch, game has version {0}, but offsets have version {1}")]
        GameVersionMismatch(usize, usize),

        #[error("memflow error: {0}")]
        Memflow(#[from] memflow::error::Error),

        #[error("memflow partial error when reading address: {0}")]
        MemflowPartialAddress(#[from] memflow::error::PartialError<Address>),

        #[error("memflow partial error when reading Vec3: {0}")]
        MemflowPartialVec3(#[from] memflow::error::PartialError<Vec3>),

        #[error("memflow partial error when reading String: {0}")]
        MemflowPartialString(#[from] memflow::error::PartialError<String>),

        #[error("memflow partial error when reading i32: {0}")]
        MemflowPartiali32(#[from] memflow::error::PartialError<i32>),

        #[error("memflow partial error when reading u32: {0}")]
        MemflowPartialu32(#[from] memflow::error::PartialError<u32>),

        #[error("memflow partial error when reading u8: {0}")]
        MemflowPartialu8(#[from] memflow::error::PartialError<u8>)
    }