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

facet-rs / facet / 14649756905

24 Apr 2025 07:09PM UTC coverage: 49.28% (-0.2%) from 49.489%
14649756905

push

github

fasterthanlime
Fix compile tests

6299 of 12782 relevant lines covered (49.28%)

61.59 hits per line

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

0.0
/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
    /// Reflection error
24
    ReflectError(facet_reflect::ReflectError),
25
}
26

27
impl From<facet_reflect::ReflectError> for Error {
28
    fn from(err: facet_reflect::ReflectError) -> Self {
×
29
        Self::ReflectError(err)
×
30
    }
×
31
}
32

33
impl fmt::Display for Error {
34
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
×
35
        match self {
×
36
            Error::UnexpectedType => write!(f, "Unexpected MessagePack type"),
×
37
            Error::InsufficientData => write!(f, "Insufficient data to decode"),
×
38
            Error::InvalidData => write!(f, "Invalid MessagePack data"),
×
39
            Error::UnknownField(field) => write!(f, "Unknown field: {}", field),
×
40
            Error::MissingField(field) => write!(f, "Missing required field: {}", field),
×
41
            Error::IntegerOverflow => write!(f, "Integer value too large for target type"),
×
42
            Error::UnsupportedShape(shape) => {
×
43
                write!(f, "Unsupported shape for deserialization: {}", shape)
×
44
            }
45
            Error::UnsupportedType(typ) => {
×
46
                write!(f, "Unsupported type for deserialization: {}", typ)
×
47
            }
48
            Error::ReflectError(err) => {
×
49
                write!(f, "Reflection error: {}", err)
×
50
            }
51
        }
52
    }
×
53
}
54

55
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