Skip to main content

rocketsplash_rt/
error.rs

1// <FILE>crates/rocketsplash-rt/src/error.rs</FILE>
2// <DESC>Runtime error types for rocketsplash-rt</DESC>
3// <VERS>VERSION: 1.0.0</VERS>
4// <WCTX>Runtime library implementation</WCTX>
5// <CLOG>Add Error enum for load/render failures</CLOG>
6
7use thiserror::Error;
8
9#[derive(Debug, Error)]
10pub enum Error {
11    #[error("IO error: {0}")]
12    Io(#[from] std::io::Error),
13
14    #[error("Invalid format: {message}")]
15    InvalidFormat { message: String },
16
17    #[error("Unsupported {format} version {found}; supported {min_supported}..={current}")]
18    UnsupportedVersion {
19        format: String,
20        found: u8,
21        min_supported: u8,
22        current: u8,
23    },
24
25    #[error("Missing glyph '{0}'")]
26    MissingGlyph(char),
27
28    #[error("Invalid color: {0}")]
29    InvalidColor(String),
30}
31
32// <FILE>crates/rocketsplash-rt/src/error.rs</FILE>
33// <VERS>END OF VERSION: 1.0.0</VERS>