Skip to content

Commit

Permalink
fix(cursor): A better error message in JsonCursor.
Browse files Browse the repository at this point in the history
Print the source JSON string in the error message.
  • Loading branch information
pravic committed Sep 17, 2024
1 parent 9465448 commit 7ff222b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ impl<T> JsonCursor<T> {
Ok(JsonRow::Row(value)) => ControlFlow::Yield(value),
Ok(JsonRow::Progress { .. }) => ControlFlow::Skip,
// TODO: another reason?
Err(err) => ControlFlow::Err(Error::BadResponse(err.to_string())),
Err(err) => ControlFlow::Err(Error::BadResponse(format!(
"{err} in {line:?}"
))),
}
} else {
ControlFlow::Err(Error::NotEnoughData)
Expand Down

0 comments on commit 7ff222b

Please sign in to comment.