codegen: Clean up error handling and move some checks to appropriate

place

Unless error handling is done in particular care, in private tools this
approach tends to make debugging easier when failed.
This commit is contained in:
Taiki Endo
2026-03-21 17:22:01 +09:00
parent 7a6eff0bac
commit 525387f706
3 changed files with 95 additions and 80 deletions

View File

@@ -61,6 +61,18 @@ impl BaseManifest {
if self.platform.is_empty() {
panic!("At least one platform must be specified");
}
if let Some(website) = &self.website {
if website.is_empty() || *website == self.repository {
panic!(
"Please do not put the repository in website, or set website to an empty value"
);
}
}
if let Some(license_markdown) = &self.license_markdown {
if license_markdown.is_empty() {
panic!("license_markdown can not be an empty value");
}
}
}
}