adding features

This commit is contained in:
DioCrafts
2025-03-19 19:52:12 +01:00
parent d9bbd575d2
commit 6e055c3043
19 changed files with 1150 additions and 42 deletions
+14
View File
@@ -17,6 +17,8 @@ pub enum ErrorKind {
Timeout,
/// Error interno del sistema
InternalError,
/// Funcionalidad no implementada
NotImplemented,
}
impl Display for ErrorKind {
@@ -28,6 +30,7 @@ impl Display for ErrorKind {
ErrorKind::AccessDenied => write!(f, "Access Denied"),
ErrorKind::Timeout => write!(f, "Timeout"),
ErrorKind::InternalError => write!(f, "Internal Error"),
ErrorKind::NotImplemented => write!(f, "Not Implemented"),
}
}
}
@@ -132,6 +135,17 @@ impl DomainError {
source: None,
}
}
/// Crea un error de funcionalidad no implementada
pub fn not_implemented<S: Into<String>>(entity_type: &'static str, message: S) -> Self {
Self {
kind: ErrorKind::NotImplemented,
entity_type,
entity_id: None,
message: message.into(),
source: None,
}
}
/// Establece el ID de la entidad
#[allow(dead_code)]