Add some context to a [target] links deserialize error.

This commit is contained in:
Eric Huss 2019-12-02 18:01:49 -08:00
parent 00a47302dd
commit c7f6528ef9

View File

@ -773,7 +773,12 @@ impl<'de> serde::Deserialize<'de> for BuildOutput {
// require an intermediate step to translate LinksOverride to
// BuildOutput, converting the ConfigRelativePath values to PathBuf.
let lo = LinksOverride::deserialize(deserializer)?;
let lo = LinksOverride::deserialize(deserializer).map_err(|e| {
serde::de::Error::custom(format!(
"failed to load config [target] links override table: {}",
e
))
})?;
if lo.warning.is_some() {
return Err(Error::custom(
"`warning` is not supported in build script overrides",