aboutsummaryrefslogtreecommitdiff
path: root/azalea-nbt/src/error.rs
blob: 05ff15e00439414eb9ad96e6fac24a38e796813c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(Debug)]
pub enum Error {
    InvalidTagType(u8),
    InvalidTag,
    WriteError,
}

impl std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::InvalidTagType(id) => write!(f, "Invalid tag type: {}", id),
            Error::InvalidTag => write!(f, "Invalid tag"),
            Error::WriteError => write!(f, "Write error"),
        }
    }
}