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

payjoin / rust-payjoin / 16441397548

22 Jul 2025 10:15AM UTC coverage: 85.727% (-0.07%) from 85.8%
16441397548

Pull #874

github

web-flow
Merge de2a271bd into 0c1b93103
Pull Request #874: Add default directory to payjoin-cli

28 of 30 new or added lines in 2 files covered. (93.33%)

44 existing lines in 4 files now uncovered.

7766 of 9059 relevant lines covered (85.73%)

517.15 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 payjoin::ImplementationError;
6
use sled::Error as SledError;
7

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

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

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

39
impl std::error::Error for Error {}
40

41
impl From<SledError> for Error {
UNCOV
42
    fn from(error: SledError) -> Self { Error::Sled(error) }
×
43
}
44

45
impl From<Error> for ImplementationError {
UNCOV
46
    fn from(error: Error) -> Self { ImplementationError::new(error) }
×
47
}
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