Skip to content

Commit 8679191

Browse files
committed
error updates
1 parent 64afd63 commit 8679191

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/error.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ pub enum ErrorKind {
5050
/// The kind of error that occurred.
5151
kind: ValueAccessErrorKind,
5252
},
53+
54+
/// A wrapped deserialization error.
55+
/// TODO RUST-1406: collapse this
56+
#[error("Deserialization error")]
57+
DeError(crate::de::Error),
5358
}
5459

5560
impl From<ErrorKind> for Error {
@@ -62,6 +67,16 @@ impl From<ErrorKind> for Error {
6267
}
6368
}
6469

70+
impl From<crate::de::Error> for Error {
71+
fn from(value: crate::de::Error) -> Self {
72+
Self {
73+
kind: ErrorKind::DeError(value),
74+
key: None,
75+
index: None,
76+
}
77+
}
78+
}
79+
6580
/// The types of errors that can occur when attempting to access a value in a document.
6681
#[derive(Debug, Error)]
6782
#[non_exhaustive]

0 commit comments

Comments
 (0)