1
0
mirror of https://github.com/pcvolkmer/cert-tools.git synced 2025-04-19 17:06:49 +00:00

chore: return error string

This commit is contained in:
Paul-Christian Volkmer 2025-01-06 17:15:39 +01:00
parent 8e898cf4bb
commit 7905603aad

View File

@ -107,10 +107,10 @@ impl Certificate {
Ok(result) Ok(result)
} }
pub fn to_pem(&self) -> Result<String, ()> { pub fn to_pem(&self) -> Result<String, String> {
match self.cert.to_pem() { match self.cert.to_pem() {
Ok(pem) => String::from_utf8(pem).map_err(|_| ()), Ok(pem) => String::from_utf8(pem).map_err(|err| err.to_string()),
Err(_) => Err(()), Err(err) => Err(err.to_string()),
} }
} }