domain: add domain errors, events, and services module scaffold

This commit is contained in:
2026-05-31 03:16:40 +02:00
parent 3571c94bec
commit aa432e6594
10 changed files with 74 additions and 4 deletions

View File

@@ -14,7 +14,9 @@ impl IntoResponse for AppError {
DomainError::NotFound(msg) => (StatusCode::NOT_FOUND, msg.clone()),
DomainError::Conflict(msg) => (StatusCode::CONFLICT, msg.clone()),
DomainError::Unauthorized(msg) => (StatusCode::UNAUTHORIZED, msg.clone()),
DomainError::Forbidden(msg) => (StatusCode::FORBIDDEN, msg.clone()),
DomainError::Validation(msg) => (StatusCode::UNPROCESSABLE_ENTITY, msg.clone()),
DomainError::QuotaExceeded(msg) => (StatusCode::PAYLOAD_TOO_LARGE, msg.clone()),
DomainError::Internal(msg) => {
tracing::error!("Internal error: {msg}");
(StatusCode::INTERNAL_SERVER_ERROR, "Internal server error".to_string())