Skip to main content

ines_core/project/
error.rs

1use crate::project::builder;
2
3pub type Result<Ok> = core::result::Result<Ok, Error>;
4
5#[derive(Debug)]
6pub enum Error {
7    Io(std::io::Error),
8    InvalidProject(String),
9    ParseConfig(toml::de::Error),
10    SerializeConfig(toml::ser::Error),
11    Builder(builder::error::Error),
12}
13
14impl From<std::io::Error> for Error {
15    fn from(io_error: std::io::Error) -> Self {
16        Self::Io(io_error)
17    }
18}
19
20impl From<toml::de::Error> for Error {
21    fn from(toml_error: toml::de::Error) -> Self {
22        Self::ParseConfig(toml_error)
23    }
24}
25
26impl From<toml::ser::Error> for Error {
27    fn from(toml_error: toml::ser::Error) -> Self {
28        Self::SerializeConfig(toml_error)
29    }
30}
31
32impl From<builder::error::Error> for Error {
33    fn from(value: builder::error::Error) -> Self {
34        Self::Builder(value)
35    }
36}