use seal_fhe::Error as SealError;
use sunscreen_runtime::FheProgramRunFailure as RuntimeError;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Error {
IRError(sunscreen_fhe_program::Error),
InvalidParams,
SealError(SealError),
KeygenFailure,
RuntimeError(RuntimeError),
ImpossibleNoiseFloor,
NotApplicable,
}
impl From<sunscreen_fhe_program::Error> for Error {
fn from(err: sunscreen_fhe_program::Error) -> Self {
Self::IRError(err)
}
}
impl From<SealError> for Error {
fn from(err: SealError) -> Self {
Self::SealError(err)
}
}
impl From<RuntimeError> for Error {
fn from(err: RuntimeError) -> Self {
Self::RuntimeError(err)
}
}
pub type Result<T> = std::result::Result<T, Error>;