1use std::io;
2
3use castep_cell_io::{CellParseError, EnergyCutoffError};
4use glob::{GlobError, PatternError};
5use thiserror::Error;
6
7use castep_param_io::param::CastepParamBuilderError;
8
9#[derive(Debug, Error)]
10pub enum SeedingErrors {
11 #[error("The glob match pattern has invalid UTF-8 characters")]
12 InvalidPattern,
13 #[error("Did not find any matching results")]
14 NoMatchingResults,
15 #[error("Pattern error during matching cell files: {0}")]
16 MatchingCellFiles(#[from] PatternError),
17 #[error("Path error during matching pattern: {0}")]
18 GlobError(#[from] GlobError),
19 #[error("Error during reading given cell file path: {0}")]
20 ReadToString(#[from] io::Error),
21 #[error("Error during parsing cell file: {0}")]
22 CellParseError(#[from] CellParseError),
23 #[error("Error during creating seed dir: {0}")]
24 CreateSeedDir(io::Error),
25 #[error("Error during creating soft link: {0}")]
26 SoftlinkError(io::Error),
27 #[error("Error during copy: {0}")]
28 CopyError(io::Error),
29 #[error("Error during writing: {0}")]
30 WriteError(io::Error),
31 #[error("Directory already exists")]
32 DirectoryExist,
33 #[error("Error getting cutoff energy: {0}")]
34 CutoffEnergy(#[from] EnergyCutoffError),
35 #[error("Error in building castep param")]
36 ParamBuildingError(#[from] CastepParamBuilderError),
37}