aboutsummaryrefslogtreecommitdiff
path: root/src/nix/verify.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/verify.cc')
-rw-r--r--src/nix/verify.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index cf1fa6a99..8c845bfc2 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -99,9 +99,15 @@ struct CmdVerify : StorePathsCommand
if (hash.first != info->narHash) {
corrupted++;
act2.result(resCorruptedPath, store->printStorePath(info->path));
- printError(
- "path '%s' was modified! expected hash '%s', got '%s'",
- store->printStorePath(info->path), info->narHash.to_string(), hash.first.to_string());
+ logError(
+ ErrorInfo {
+ .name = "Hash error - path modified",
+ .hint = hintfmt(
+ "path '%s' was modified! expected hash '%s', got '%s'",
+ store->printStorePath(info->path),
+ info->narHash.to_string(),
+ hash.first.to_string())
+ });
}
}
@@ -139,7 +145,7 @@ struct CmdVerify : StorePathsCommand
doSigs(info2->sigs);
} catch (InvalidPath &) {
} catch (Error & e) {
- printError(format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
+ logError(e.info());
}
}
@@ -150,7 +156,13 @@ struct CmdVerify : StorePathsCommand
if (!good) {
untrusted++;
act2.result(resUntrustedPath, store->printStorePath(info->path));
- printError("path '%s' is untrusted", store->printStorePath(info->path));
+ logError(
+ ErrorInfo {
+ .name = "Untrusted path",
+ .hint = hintfmt("path '%s' is untrusted",
+ store->printStorePath(info->path))
+ });
+
}
}
@@ -158,7 +170,7 @@ struct CmdVerify : StorePathsCommand
done++;
} catch (Error & e) {
- printError(format(ANSI_RED "error:" ANSI_NORMAL " %s") % e.what());
+ logError(e.info());
failed++;
}