Skip to content

Commit 7ff222b

Browse files
committed
fix(cursor): A better error message in JsonCursor.
Print the source JSON string in the error message.
1 parent 9465448 commit 7ff222b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cursor.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ impl<T> JsonCursor<T> {
174174
Ok(JsonRow::Row(value)) => ControlFlow::Yield(value),
175175
Ok(JsonRow::Progress { .. }) => ControlFlow::Skip,
176176
// TODO: another reason?
177-
Err(err) => ControlFlow::Err(Error::BadResponse(err.to_string())),
177+
Err(err) => ControlFlow::Err(Error::BadResponse(format!(
178+
"{err} in {line:?}"
179+
))),
178180
}
179181
} else {
180182
ControlFlow::Err(Error::NotEnoughData)

0 commit comments

Comments
 (0)