use thiserror::Error;
#[derive(Debug, Error)]
pub enum ZplError {
#[error("Parse error at line {line}: {message}")]
ParseError {
line: usize,
message: String,
},
#[error("Instruction builder error: {0}")]
InstructionError(String),
#[error("Rendering backend error: {0}")]
BackendError(String),
#[error("Font error: {0}")]
FontError(String),
#[error("Empty or invalid ZPL input")]
EmptyInput,
#[error("Image processing error: {0}")]
ImageError(String),
#[error("Security limit exceeded: {0}")]
SecurityLimitExceeded(String),
#[error("Unexpected error: {0}")]
Unexpected(String),
}
pub type ZplResult<T> = Result<T, ZplError>;