mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
radicle: validations
Instead of returning the unsigned references, the validation of a repository's remotes returns the set of validation errors. The caller is then expected to handle these validation errors appropriately, for example, by logging them and re-raising an error. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -106,7 +106,14 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
identity.update("Publish repository", "", &doc, &signer)?;
|
||||
repo.sign_refs(&signer)?;
|
||||
repo.set_identity_head()?;
|
||||
repo.validate()?;
|
||||
let validations = repo.validate()?;
|
||||
|
||||
if !validations.is_empty() {
|
||||
for err in validations {
|
||||
term::error(format!("Error: validation error {err}"));
|
||||
}
|
||||
anyhow::bail!("fatal error: repository storage is corrupt");
|
||||
}
|
||||
|
||||
term::success!(
|
||||
"Repository is now {}",
|
||||
|
||||
Reference in New Issue
Block a user