mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-06 11:30:44 +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(());
|
return Ok(());
|
||||||
} else {
|
} else {
|
||||||
// TODO: Error handling
|
return Err(ServiceError::AgeNoRecipientsError);
|
||||||
unreachable!("No recipients provided");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ pub enum ServiceError {
|
||||||
CandidateDetailsNotSet,
|
CandidateDetailsNotSet,
|
||||||
#[error("Tokio join error")]
|
#[error("Tokio join error")]
|
||||||
TokioJoinError(#[from] tokio::task::JoinError),
|
TokioJoinError(#[from] tokio::task::JoinError),
|
||||||
|
#[error("Age no recipients error")]
|
||||||
|
AgeNoRecipientsError,
|
||||||
#[error("Age encrypt error")]
|
#[error("Age encrypt error")]
|
||||||
AgeEncryptError(#[from] age::EncryptError),
|
AgeEncryptError(#[from] age::EncryptError),
|
||||||
#[error("Age decrypt error")]
|
#[error("Age decrypt error")]
|
||||||
|
|
@ -88,6 +90,7 @@ impl ServiceError {
|
||||||
ServiceError::CryptoEncryptFailed => 500,
|
ServiceError::CryptoEncryptFailed => 500,
|
||||||
ServiceError::CryptoDecryptFailed => 500,
|
ServiceError::CryptoDecryptFailed => 500,
|
||||||
ServiceError::CandidateDetailsNotSet => 500,
|
ServiceError::CandidateDetailsNotSet => 500,
|
||||||
|
ServiceError::AgeNoRecipientsError => 500,
|
||||||
ServiceError::AgeEncryptError(_) => 500,
|
ServiceError::AgeEncryptError(_) => 500,
|
||||||
ServiceError::AgeDecryptError(_) => 500,
|
ServiceError::AgeDecryptError(_) => 500,
|
||||||
ServiceError::AgeKeyError(_) => 500,
|
ServiceError::AgeKeyError(_) => 500,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue