summaryrefslogtreecommitdiffstats
path: root/openpgp/src/policy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/policy.rs')
-rw-r--r--openpgp/src/policy.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/openpgp/src/policy.rs b/openpgp/src/policy.rs
index 03d36b02..542fa64f 100644
--- a/openpgp/src/policy.rs
+++ b/openpgp/src/policy.rs
@@ -1489,9 +1489,11 @@ impl<'a> Policy for StandardPolicy<'a> {
.context("Policy rejected critical signature subpacket")?;
if let SubpacketValue::NotationData(n) = csp.value() {
if ! self.good_critical_notations.contains(&n.name()) {
- return Err(Error::PolicyViolation(
- format!("Policy rejected critical notation {:?}",
- n.name()), None).into());
+ return Err(anyhow::Error::from(
+ Error::PolicyViolation(
+ format!("Critical notation {:?}",
+ n.name()), None))
+ .context("Policy rejected critical notation"));
}
}
}