ForgeFlux/src/forge/auth/application/services/request_authorization/errors.rs
Aravinth Manivannan 85d7d9d322
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
feat: OAuth request authoriation service
2024-05-04 22:48:40 +05:30

29 lines
895 B
Rust

use derive_more::Display;
use serde::{Deserialize, Serialize};
use crate::forge::auth::application::port::out::db::errors::OutDBPortError;
use crate::forge::auth::application::port::out::forge::errors::OutForgePortError;
pub type RequestAuthorizationServiceResult<V> = Result<V, RequestAuthorizationServiceError>;
#[derive(Debug, Display, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub enum RequestAuthorizationServiceError {
InteralError,
}
impl From<OutDBPortError> for RequestAuthorizationServiceError {
fn from(v: OutDBPortError) -> Self {
match v {
OutDBPortError::DuplicateState => Self::InteralError,
}
}
}
impl From<OutForgePortError> for RequestAuthorizationServiceError {
fn from(v: OutForgePortError) -> Self {
match v {
OutForgePortError::InteralError => Self::InteralError,
}
}
}