1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Decoding error types for object deserialization.
//!
//! This module provides error handling for decoding failures that occur during
//! deserialization of objects from various formats (JSON, msgpack, etc.).
//! The [`DecodeError`] struct wraps underlying format-specific errors into a
//! unified error type that can be propagated through the application.
//!
//! # Examples
//!
//! ```
//! use object_transfer::errors::DecodeError;
//!
//! // Errors from different formats are automatically converted to DecodeError
//! let json_err: DecodeError<serde_json::Error> = serde_json::from_str::<i32>("invalid").unwrap_err().into();
//! ```
use Error as DeErr;
use Error;
/// Error type for deserialization failures.
///
/// This struct wraps format-agnostic decoding errors from various serialization
/// backends (JSON, msgpack, etc.). It uses `thiserror` to provide consistent
/// error formatting and conversion from format-specific error types.
///
/// The underlying error is boxed to allow different serialization formats to
/// contribute their own error types without requiring a large enum variant.
/// Converts JSON deserialization errors into [`DecodeError`].
///
/// This conversion is only available when the `json` feature is enabled.
/// Converts MessagePack deserialization errors into [`DecodeError`].
///
/// This conversion is only available when the `msgpack` feature is enabled.