Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Derive thiserror::Error for HexColorError (again) (#4847)
This was first done in 7b4e3a5, but was then reverted when the new renderer for 0.6 was merged (ffecb05). I'm assuming it was simply a mistake when merging. # Objective - Same as #2740, I think it was reverted by mistake when merging. > # Objective > > - Make it easy to use HexColorError with `thiserror`, i.e. converting it into other error types. > > Makes this possible: > > ```rust > #[derive(Debug, thiserror::Error)] > pub enum LdtkError { > #[error("An error occured while deserializing")] > Json(#[from] serde_json::Error), > #[error("An error occured while parsing a color")] > HexColor(#[from] bevy::render::color::HexColorError), > } > ``` > > ## Solution > > - Derive thiserror::Error the same way we do elsewhere (see query.rs for instance)
- Loading branch information