Harmonise error messages

This commit is contained in:
Simon Bruder 2020-08-07 13:16:21 +02:00
parent a252a3d444
commit f8ed0e2f1a
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
3 changed files with 6 additions and 6 deletions

View file

@ -19,9 +19,9 @@ const MAGIC: u32 = 0x19751120;
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum Error { pub enum Error {
#[error("Invalid magic (expected {expected:#x}, found {found:#x})")] #[error("invalid magic (expected {expected:#x}, found {found:#x})")]
InvalidMagic { expected: u32, found: u32 }, InvalidMagic { expected: u32, found: u32 },
#[error("Invalid size after decompresseion (expected {expected}, found {found})")] #[error("invalid size after decompresseion (expected {expected}, found {found})")]
DecompressionSize { expected: usize, found: usize }, DecompressionSize { expected: usize, found: usize },
#[error(transparent)] #[error(transparent)]
IOError(#[from] io::Error), IOError(#[from] io::Error),

View file

@ -18,11 +18,11 @@ const MEASURE_LENGTH: f32 = 4096.0;
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum Error { pub enum Error {
#[error("Not enough freeze data was found")] #[error("not enough freeze data was found")]
NotEnoughFreezeData, NotEnoughFreezeData,
#[error("Invalid player count {0} (valid options: 1, 2)")] #[error("invalid player count {0} (valid options: 1, 2)")]
InvalidPlayerCount(u8), InvalidPlayerCount(u8),
#[error("Invalid difficulty {0} (valid options: 4, 1, 2, 3, 6)")] #[error("invalid difficulty {0} (valid options: 4, 1, 2, 3, 6)")]
InvalidDifficulty(u8), InvalidDifficulty(u8),
#[error(transparent)] #[error(transparent)]
IOError(#[from] io::Error), IOError(#[from] io::Error),

View file

@ -18,7 +18,7 @@ use crate::xact3::adpcm;
pub enum Error { pub enum Error {
#[error("{0:?} is not a supported format")] #[error("{0:?} is not a supported format")]
UnsupportedFormat(FormatTag), UnsupportedFormat(FormatTag),
#[error("Invalid magic: expected “WBND”, found “{0}”")] #[error("invalid magic (expected “WBND”, found “{0}”)")]
InvalidMagic(String), InvalidMagic(String),
#[error(transparent)] #[error(transparent)]
IOError(#[from] io::Error), IOError(#[from] io::Error),