1use std::error::Error as StdError;
2use std::fmt;
3
4use fehler::throws;
5
6#[derive(Debug)]
8pub enum Error {
9 ConfigInstallError {
11 description: &'static str,
13 cause: Option<Box<dyn StdError>>,
15 },
16}
17
18impl fmt::Display for Error {
19 #[throws(fmt::Error)]
20 fn fmt(&self, f: &mut fmt::Formatter) {
21 match self {
22 Error::ConfigInstallError { description, .. } => {
23 write!(f, "CS:GO GSI config install error: {}", description)?;
24 }
25 }
26 }
27}
28
29impl StdError for Error {
30 fn source(&self) -> Option<&(dyn StdError + 'static)> {
31 match self {
32 Error::ConfigInstallError { cause, .. } => cause.as_deref()
33 }
34 }
35}