Improve error message.

This commit is contained in:
Tom Alexander 2023-09-29 22:27:31 -04:00
parent fc7d4bd949
commit 6c77586960
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -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());
}
}