diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-05-10 11:39:34 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-05-10 11:39:34 +0200 |
commit | b1e50de55bbfa5a2fcbde1baf30dc28f929f2f4e (patch) | |
tree | 4ad98cc84d1d6ea563a3040198fb1c1c7069a607 /openpgp/src | |
parent | cf7bfeaeb868bea77cc38db818a64cb9fdbfcda8 (diff) |
openpgp: Add some context to errors
Diffstat (limited to 'openpgp/src')
-rw-r--r-- | openpgp/src/packet/userid.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index d1ee9895..dd8e5126 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -4,6 +4,7 @@ use std::hash::{Hash, Hasher}; use std::cell::RefCell; use quickcheck::{Arbitrary, Gen}; use rfc2822::{NameAddr, AddrSpec}; +use failure::ResultExt; use Result; use packet; @@ -135,7 +136,9 @@ impl UserID { (None, None, Some(a.address().to_string())) } else { // Return the error from the NameAddr parser. - return Err(err.into()); + let err : failure::Error = err.into(); + return Err(err).context(format!( + "Not a valid RFC 2822 mailbox: {:?}", s))?; } } }); |