Skip to content

Commit bd5aea9

Browse files
Preslav LeConvex, Inc.
authored andcommitted
Log the documentId that failed to parse (#24888)
Log the documentId of the document that failed to parse. GitOrigin-RevId: 88c5e28ca79e83b610ce5e236afa27a2994dd18e
1 parent 650ff39 commit bd5aea9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

crates/common/src/document.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,16 +773,20 @@ impl<D> ParsedDocument<D> {
773773
}
774774
}
775775

776-
impl<D, E> TryFrom<ResolvedDocument> for ParsedDocument<D>
776+
impl<D> TryFrom<ResolvedDocument> for ParsedDocument<D>
777777
where
778-
D: TryFrom<ConvexObject, Error = E>,
778+
D: TryFrom<ConvexObject, Error = anyhow::Error>,
779779
{
780-
type Error = E;
780+
type Error = anyhow::Error;
781781

782-
fn try_from(document: ResolvedDocument) -> Result<Self, E> {
782+
fn try_from(document: ResolvedDocument) -> anyhow::Result<Self> {
783783
let id = document.id;
784784
let creation_time = document.creation_time;
785-
let value: D = document.into_value().0.try_into()?;
785+
let value: D = document
786+
.into_value()
787+
.0
788+
.try_into()
789+
.with_context(|| format!("Failed to parse document id: {id}"))?;
786790
Ok(Self {
787791
id,
788792
creation_time,

0 commit comments

Comments
 (0)