camel_language_js/error.rs
1use thiserror::Error;
2
3/// Errors produced by the JavaScript language plugin.
4#[derive(Debug, Error)]
5pub enum JsLanguageError {
6 /// The JavaScript source failed to parse or execute.
7 #[error("JS execution error: {message}")]
8 Execution { message: String },
9
10 /// The value returned by the script could not be converted to the expected type.
11 #[error("JS type conversion error: {message}")]
12 TypeConversion { message: String },
13
14 /// A required header or property was not found on the exchange.
15 #[error("JS exchange access error: {message}")]
16 ExchangeAccess { message: String },
17
18 /// The JS source could not be compiled/parsed.
19 #[error("JS parse error: {message}")]
20 Parse { message: String },
21}