textfsm_core/clitable/
error.rs1use std::collections::HashMap;
4use std::path::PathBuf;
5
6use thiserror::Error;
7
8use crate::error::{ParseError, TemplateError};
9
10#[derive(Error, Debug)]
12pub enum CliTableError {
13 #[error("index parse error at line {line}: {message}")]
15 IndexParse { line: usize, message: String },
16
17 #[error("no matching template found for attributes: {0:?}")]
19 NoMatch(HashMap<String, String>),
20
21 #[error("template file not found: {0}")]
23 TemplateNotFound(PathBuf),
24
25 #[error("invalid completion syntax: {0}")]
27 InvalidCompletion(String),
28
29 #[error("invalid regex pattern at line {line}: {message}")]
31 InvalidRegex { line: usize, message: String },
32
33 #[error("missing required column '{0}' in index file")]
35 MissingColumn(String),
36
37 #[error(transparent)]
39 Template(#[from] TemplateError),
40
41 #[error(transparent)]
43 Parse(#[from] ParseError),
44
45 #[error("I/O error: {0}")]
47 Io(#[from] std::io::Error),
48}