fix(core): update error wording for invalid version field (#14800)

* fix(core): update error wording for invalid version field

fixes #14799

* fmt
This commit is contained in:
Fabian-Lars
2026-01-21 03:42:15 +01:00
committed by GitHub
parent f82594410c
commit c862a0bd8c

View File

@@ -3164,18 +3164,20 @@ impl<'d> serde::Deserialize<'d> for PackageVersion {
})?;
Ok(PackageVersion(
Version::from_str(version)
.map_err(|_| DeError::custom("`package > version` must be a semver string"))?
.map_err(|_| {
DeError::custom("`tauri.conf.json > version` must be a semver string")
})?
.to_string(),
))
} else {
Err(DeError::custom(
"`package > version` value is not a path to a JSON object",
"`tauri.conf.json > version` value is not a path to a JSON object",
))
}
} else {
Ok(PackageVersion(
Version::from_str(value)
.map_err(|_| DeError::custom("`package > version` must be a semver string"))?
.map_err(|_| DeError::custom("`tauri.conf.json > version` must be a semver string"))?
.to_string(),
))
}