From 6c775869607cc1041978518dfce5e9d5f3c8025c Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 29 Sep 2023 22:27:31 -0400 Subject: [PATCH] Improve error message. --- src/compare/diff.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 1f7e1ce..5d68d32 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -512,7 +512,11 @@ pub fn compare_document<'s>( .ok_or("Should have a corresponding heading.")?; child_status.push(compare_heading(rust.source, token, corresponding_heading)?); } else { - return Err("Document should only contain sections and headlines.".into()); + return Err(format!( + "Document should only contain sections and headlines, found: {}", + first_cell + ) + .into()); } }