diff options
| author | mat <github@matdoes.dev> | 2021-12-20 15:22:02 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-20 15:22:02 -0600 |
| commit | 6ae94b96e6d51e3bf251d4a01f17fa7d41c9500f (patch) | |
| tree | 3153984562016e703eefd71b4b1de4151d47fdde /azalea-nbt/src/error.rs | |
| parent | cf88c7b7956398eba2e0d6ed86dbf3268fdb512b (diff) | |
| download | azalea-drasl-6ae94b96e6d51e3bf251d4a01f17fa7d41c9500f.tar.xz | |
start adding nbt to the protocol
Diffstat (limited to 'azalea-nbt/src/error.rs')
| -rw-r--r-- | azalea-nbt/src/error.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/azalea-nbt/src/error.rs b/azalea-nbt/src/error.rs index 3ada7cf7..05ff15e0 100644 --- a/azalea-nbt/src/error.rs +++ b/azalea-nbt/src/error.rs @@ -4,3 +4,13 @@ pub enum Error { 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"), + } + } +} |
