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: 2.0.0</VERS>
4// <WCTX>Foundation crates 0.3.0 (RELEASE_PLAN D2 typed errors)</WCTX>
5// <CLOG>2.0.0: wrap rocketsplash_formats::FormatError transparently; drop UnsupportedVersion (now reported by FormatError). 1.0.0: 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    /// Format-level failure: decode errors, version windows, structural
15    /// limits. Produced by the `rocketsplash-formats` decode entry points.
16    #[error(transparent)]
17    Format(#[from] rocketsplash_formats::FormatError),
18
19    #[error("Invalid format: {message}")]
20    InvalidFormat { message: String },
21
22    #[error("Missing glyph '{0}'")]
23    MissingGlyph(char),
24
25    #[error("Invalid color: {0}")]
26    InvalidColor(String),
27}
28
29// <FILE>crates/rocketsplash-rt/src/error.rs</FILE>
30// <VERS>END OF VERSION: 2.0.0</VERS>