1use core::fmt::Debug;
2
3use rhai::{LexError, ParseError};
4use rusvid_core::plane::PlaneError;
5use thiserror::Error;
6
7#[derive(Error, Debug)]
8pub enum RhaiError {
9 #[error("Error encountered when tokenizing the script text. {0:?}")]
10 Lex(LexError),
11
12 #[error("Error when parsing a script. {0:?}")]
13 Parse(ParseError),
14}
15
16#[derive(Error, Debug)]
17pub enum EffectError {
18 #[error("error occurred in `Plane`: {0:?}")]
19 Plane(#[from] PlaneError),
20
21 #[error("error occurred in rhai: {0:?}")]
22 Rhai(#[from] RhaiError),
23
24 #[error("{message}: {value}")]
25 SizeError { message: &'static str, value: u32 },
26}