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

facet-rs / facet / 15022217137

14 May 2025 01:38PM UTC coverage: 59.025% (+0.4%) from 58.592%
15022217137

Pull #614

github

web-flow
Merge c537e58cd into 7c93673e1
Pull Request #614: Introduce `facet_testhelpers::test` attribute

175 of 252 new or added lines in 3 files covered. (69.44%)

1 existing line in 1 file now uncovered.

10105 of 17120 relevant lines covered (59.02%)

122.48 hits per line

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

22.73
/facet-msgpack/src/errors.rs
1
use core::fmt;
2

3
#[derive(Debug)]
4
#[non_exhaustive]
5
/// Errors that can occur during MessagePack encoding/decoding operations
6
pub enum Error {
7
    /// Encountered a MessagePack type that doesn't match the expected type
8
    UnexpectedType,
9
    /// Not enough data available to decode a complete MessagePack value
10
    InsufficientData,
11
    /// The MessagePack data is malformed or corrupted
12
    InvalidData,
13
    /// Encountered a field name that isn't recognized
14
    UnknownField(String),
15
    /// Required field is missing from the input
16
    MissingField(String),
17
    /// Integer value is too large for the target type
18
    IntegerOverflow,
19
    /// Shape is not supported for deserialization
20
    UnsupportedShape(String),
21
    /// Type is not supported for deserialization
22
    UnsupportedType(String),
23
    /// Feature not yet implemented
24
    NotImplemented(String),
25
    /// Reflection error
26
    ReflectError(facet_reflect::ReflectError),
27
    /// Invalid enum variant
28
    InvalidEnum(String),
29
}
30

31
impl From<facet_reflect::ReflectError> for Error {
32
    fn from(err: facet_reflect::ReflectError) -> Self {
×
33
        Self::ReflectError(err)
×
34
    }
×
35
}
36

37
impl fmt::Display for Error {
38
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2✔
39
        match self {
2✔
40
            Error::UnexpectedType => write!(f, "Unexpected MessagePack type"),
1✔
41
            Error::InsufficientData => write!(f, "Insufficient data to decode"),
1✔
42
            Error::InvalidData => write!(f, "Invalid MessagePack data"),
×
43
            Error::UnknownField(field) => write!(f, "Unknown field: {}", field),
×
44
            Error::MissingField(field) => write!(f, "Missing required field: {}", field),
×
45
            Error::IntegerOverflow => write!(f, "Integer value too large for target type"),
×
46
            Error::UnsupportedShape(shape) => {
×
47
                write!(f, "Unsupported shape for deserialization: {}", shape)
×
48
            }
49
            Error::UnsupportedType(typ) => {
×
50
                write!(f, "Unsupported type for deserialization: {}", typ)
×
51
            }
NEW
52
            Error::NotImplemented(feature) => {
×
NEW
53
                write!(f, "Feature not yet implemented: {}", feature)
×
54
            }
55
            Error::ReflectError(err) => {
×
56
                write!(f, "Reflection error: {}", err)
×
57
            }
NEW
58
            Error::InvalidEnum(message) => {
×
NEW
59
                write!(f, "Invalid enum variant: {}", message)
×
60
            }
61
        }
62
    }
2✔
63
}
64

65
impl std::error::Error for Error {}
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