rsiot/components/cmp_filesystem/
error.rs

1use crate::executor::ComponentError;
2
3#[allow(missing_docs)]
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("CmpOutput: {0}")]
7    CmpOutput(ComponentError),
8
9    #[error("FnOutput: {0}")]
10    FnInput(anyhow::Error),
11
12    #[error("FnOutput: {0}")]
13    FnOutput(anyhow::Error),
14
15    #[error("TokioTaskJoin: {0}")]
16    TokioTaskJoin(#[from] tokio::task::JoinError),
17
18    #[error("WriteFileError: {0}; filename: {1}")]
19    WriteFileError(std::io::Error, String),
20
21    #[error("ReadFileError: {0}")]
22    ReadFileError(std::io::Error),
23
24    #[error("ReadDirEntryError: {0}")]
25    ReadDirEntryError(std::io::Error),
26
27    #[error("TokioMpscSend")]
28    TokioMpscSend,
29
30    #[error(transparent)]
31    Serde(#[from] crate::serde_utils::Error),
32}
33
34impl From<Error> for ComponentError {
35    fn from(value: Error) -> Self {
36        ComponentError::Execution(value.to_string())
37    }
38}