Skip to main content

opentimestamps_cli/
error.rs

1// Copyright (C) 2024 The OpenTimestamps developers
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5    #[error("Network error")]
6    NetworkError(reqwest::Error),
7    #[error("Ots error")]
8    InvalidOts(ots::error::Error),
9    #[error("IO error")]
10    IOError,
11    #[error("Invalid file error")]
12    InvalidFile,
13    #[error("Bitcoin node error")]
14    BitcoinNodeError,
15    // TODO remove into specific errors
16    #[error("Generic error {0}")]
17    Generic(String),
18}
19impl From<String> for Error {
20    fn from(message: String) -> Self {
21        Error::Generic(message)
22    }
23}