1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 18:54:05 +02:00

handle other binreader errors

This commit is contained in:
Robin Appelman 2022-02-20 16:39:45 +01:00
commit 21b78f9efe

View file

@ -22,6 +22,8 @@ pub enum BspError {
IO(#[from] std::io::Error),
#[error(transparent)]
String(#[from] StringError),
#[error("Malformed field found while parsing: {0:#}")]
MalformedData(binrw::Error),
}
impl From<binrw::Error> for BspError {
@ -38,7 +40,7 @@ impl From<binrw::Error> for BspError {
panic!("unexpected custom error")
}
}
e => panic!("unexpected no variable match: {:?}", e),
e => BspError::MalformedData(e),
}
}
}