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)
}
pub fn to_pem(&self) -> Result<String, ()> {
pub fn to_pem(&self) -> Result<String, String> {
match self.cert.to_pem() {
Ok(pem) => String::from_utf8(pem).map_err(|_| ()),
Err(_) => Err(()),
Ok(pem) => String::from_utf8(pem).map_err(|err| err.to_string()),
Err(err) => Err(err.to_string()),
}
}