netlist/
error.rs

1use thiserror::Error;
2#[derive(Debug, Error)]
3pub enum NetListError {
4    #[error("Failed to operate from netlist data")]
5    OpsErr {
6        #[from]
7        source: OpsErr,
8    },
9    #[error("Failed to parse verilog\nbecause `{0}`")]
10    ParseErr(String),
11    #[error("Failed to parse portlist from xml\nbecause ")]
12    PortListErr{
13        #[from]
14        source: serde_xml_rs::Error,
15    },    
16    #[error("Failed to save verilog")]
17    SaveErr {
18        #[from]
19        source: std::io::Error,
20    },
21}
22
23#[derive(Debug, Error)]
24pub enum OpsErr {
25    #[error("Net `{0}` not found in the netlist `{1}`")]
26    NetNotFound(String, String),
27    #[error("Gate `{0}` not found in the netlist `{1}`")]
28    GateNotFound(String, String),
29    #[error("Pin `{0}` not found in the netlist `{1}`")]
30    PinNotFound(String, String),
31    #[error("Sever Error in the system")]
32    SeverError,
33    #[error("Gate `{0}` already in the netlist `{1}` ")]
34    GateAlreadyExist(String, String),
35}