• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

payjoin / rust-payjoin / 15449745260

04 Jun 2025 06:20PM UTC coverage: 85.058% (+0.003%) from 85.055%
15449745260

Pull #726

github

web-flow
Merge 315a4f504 into 1063687eb
Pull Request #726: Merge parallel feature flag local certificate logic in cli ohttp

58 of 71 new or added lines in 4 files covered. (81.69%)

12 existing lines in 1 file now uncovered.

6831 of 8031 relevant lines covered (85.06%)

577.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/payjoin-cli/src/db/error.rs
1
use std::fmt;
2

3
#[cfg(feature = "v2")]
4
use bitcoincore_rpc::jsonrpc::serde_json;
5
use sled::Error as SledError;
6

7
pub(crate) type Result<T> = std::result::Result<T, Error>;
8

9
#[derive(Debug)]
10
pub(crate) enum Error {
11
    Sled(SledError),
12
    #[cfg(feature = "v2")]
13
    Serialize(serde_json::Error),
14
    #[cfg(feature = "v2")]
15
    Deserialize(serde_json::Error),
16
    #[cfg(feature = "v2")]
17
    NotFound(String),
18
}
19

20
impl fmt::Display for Error {
21
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
×
22
        match self {
×
23
            Error::Sled(e) => write!(f, "Database operation failed: {e}"),
×
24
            #[cfg(feature = "v2")]
×
25
            Error::Serialize(e) => write!(f, "Serialization failed: {e}"),
×
26
            #[cfg(feature = "v2")]
×
27
            Error::Deserialize(e) => write!(f, "Deserialization failed: {e}"),
×
28
            #[cfg(feature = "v2")]
×
29
            Error::NotFound(key) => write!(f, "Key not found: {key}"),
×
30
        }
×
31
    }
×
32
}
33

34
impl std::error::Error for Error {}
35

36
impl From<SledError> for Error {
37
    fn from(error: SledError) -> Self { Error::Sled(error) }
×
38
}
39

40
impl Clone for Error {
NEW
41
    fn clone(&self) -> Self {
×
NEW
42
        match self {
×
NEW
43
            Error::Sled(_) => Error::Sled(SledError::Unsupported("Cloned placeholder".into())),
×
NEW
44
            #[cfg(feature = "v2")]
×
NEW
45
            Error::Serialize(_) =>
×
NEW
46
                Error::Serialize(serde::ser::Error::custom("Cloned placeholder")),
×
NEW
47
            #[cfg(feature = "v2")]
×
NEW
48
            Error::Deserialize(_) =>
×
NEW
49
                Error::Deserialize(serde::de::Error::custom("Cloned placeholder")),
×
NEW
50
            #[cfg(feature = "v2")]
×
NEW
51
            Error::NotFound(key) => Error::NotFound(key.clone()),
×
NEW
52
        }
×
NEW
53
    }
×
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc