From c52a05e6d3977efce6bd4479aa312dc90e0452e5 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:23 +0100 Subject: feat(render): proper error handling --- stockton-levels/src/types.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'stockton-levels/src') diff --git a/stockton-levels/src/types.rs b/stockton-levels/src/types.rs index 7cc4671..dd42a5e 100644 --- a/stockton-levels/src/types.rs +++ b/stockton-levels/src/types.rs @@ -1,6 +1,7 @@ //! Various types used in parsed BSP files. use std::convert::TryInto; +use thiserror::Error; /// RGBA Colour (0-255) #[derive(Debug, Clone, Copy, PartialEq)] @@ -65,10 +66,13 @@ impl Rgb { } } -#[derive(Debug)] +#[derive(Error, Debug)] /// An error encountered while parsing. pub enum ParseError { + #[error("Unsupported format")] Unsupported, + + #[error("Invalid file")] Invalid, } -- cgit v1.2.3