include element/attribute in errors

This commit is contained in:
Evan Almloff committed 2022-06-15 14:20:36 -05:00
1 parent d9ee305575
commit b761bdb767
1 file changed
+2 -2
+2 -2
View File
@@ -103,7 +103,7 @@ fn build_node<'a>(
}); });
} else { } else {
return Err(Error::ParseError(ParseError::new( return Err(Error::ParseError(ParseError::new(
syn::Error::new(span, "unknown attribute"), syn::Error::new(span, format!("unknown attribute: {}", name)),
ctx.location.clone(), ctx.location.clone(),
))); )));
} }
@@ -207,7 +207,7 @@ fn build_node<'a>(
} }
} else { } else {
Err(Error::ParseError(ParseError::new( Err(Error::ParseError(ParseError::new(
syn::Error::new(el.name.span(), "unknown element"), syn::Error::new(el.name.span(), format!("unknown element: {}", tag)),
ctx.location.clone(), ctx.location.clone(),
))) )))
} }