diff --git a/crates/kra/src/lib.rs b/crates/kra/src/lib.rs index 12ae3468b..71b7b8ff8 100644 --- a/crates/kra/src/lib.rs +++ b/crates/kra/src/lib.rs @@ -247,7 +247,10 @@ impl Image { limits: craft_xml::Limits { max_input: MAX_MAINDOC, max_depth: MAX_XML_DEPTH, ..craft_xml::Limits::DEFAULT }, ..craft_xml::Options::local().strict() }; - let root = options.parse(maindoc).map_err(|e| invalid(format!("maindoc.xml: {e}")))?; + let root = options.parse(maindoc).map_err(|e| match e { + craft_xml::Error::Doctype => invalid("maindoc.xml: an internal DTD is not accepted"), + other => invalid(format!("maindoc.xml: {other}")), + })?; let image = root.child("IMAGE").ok_or_else(|| invalid("maindoc.xml has no IMAGE"))?; let side = |a: &str| -> Result { let v = number(image, a, 0.0)?;