Skip to content

Commit 4bc95a0

Browse files
committed
Improve error message for bad front matter
1 parent 009d4c7 commit 4bc95a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: front_matter/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ mod tests {
6363

6464
for post in posts {
6565
let content = fs::read_to_string(&post).unwrap();
66-
let normalized = normalize(&content).unwrap();
66+
let normalized = normalize(&content).unwrap_or_else(|err| {
67+
panic!("failed to normalize {:?}: {err}", post.file_name().unwrap());
68+
});
6769

6870
if content != normalized {
6971
if env::var("FIX_FRONT_MATTER").is_ok() {

0 commit comments

Comments
 (0)