mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-19 06:21:15 +00:00
feat: age no recipients error
This commit is contained in:
parent
fb07608114
commit
d797477393
2 changed files with 4 additions and 2 deletions
|
|
@ -222,8 +222,7 @@ async fn age_encrypt_with_recipients<W: tokio::io::AsyncWrite + Unpin>(
|
|||
|
||||
return Ok(());
|
||||
} else {
|
||||
// TODO: Error handling
|
||||
unreachable!("No recipients provided");
|
||||
return Err(ServiceError::AgeNoRecipientsError);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ pub enum ServiceError {
|
|||
CandidateDetailsNotSet,
|
||||
#[error("Tokio join error")]
|
||||
TokioJoinError(#[from] tokio::task::JoinError),
|
||||
#[error("Age no recipients error")]
|
||||
AgeNoRecipientsError,
|
||||
#[error("Age encrypt error")]
|
||||
AgeEncryptError(#[from] age::EncryptError),
|
||||
#[error("Age decrypt error")]
|
||||
|
|
@ -88,6 +90,7 @@ impl ServiceError {
|
|||
ServiceError::CryptoEncryptFailed => 500,
|
||||
ServiceError::CryptoDecryptFailed => 500,
|
||||
ServiceError::CandidateDetailsNotSet => 500,
|
||||
ServiceError::AgeNoRecipientsError => 500,
|
||||
ServiceError::AgeEncryptError(_) => 500,
|
||||
ServiceError::AgeDecryptError(_) => 500,
|
||||
ServiceError::AgeKeyError(_) => 500,
|
||||
|
|
|
|||
Loading…
Reference in a new issue