bind/bytecode_encoder/
error.rs1use crate::errors::UserError;
6use crate::parser::bind_library;
7use std::fmt;
8use thiserror::Error;
9
10#[derive(Debug, Error, Clone, PartialEq)]
11pub enum BindRulesEncodeError {
12 InvalidStringLength(String),
13 UnsupportedSymbol,
14 IntegerOutOfRange,
15 MismatchValueTypes(bind_library::ValueType, bind_library::ValueType),
16 IncorrectTypesInValueComparison,
17 DuplicateLabel(u32),
18 MissingLabel(u32),
19 InvalidGotoLocation(u32),
20 JumpOffsetOutOfRange(u32),
21 MatchNotSupported,
22 MissingCompositeDeviceName,
23 MissingCompositeNodeName,
24 DuplicateCompositeNodeName(String),
25 MissingAstLocation,
26}
27
28impl fmt::Display for BindRulesEncodeError {
29 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30 write!(f, "{}", UserError::from(self.clone()))
31 }
32}