docs+fix: update arch diagram/README/Insomnia, ApiError returns JSON

- architecture.mmd: CQRS trait names, ImageFetcher/RssFeedRenderer
  ports, infra-wiring crate, api-types description
- README: add infra-wiring, note CQRS ports
- Insomnia: add PATCH /api/v1/reviews/:id
- ApiError returns {"error":"..."} JSON not plain text
This commit is contained in:
2026-07-10 03:52:49 +02:00
parent dee013c7eb
commit 2e32847129
4 changed files with 45 additions and 7 deletions

View File

@@ -36,6 +36,13 @@ impl From<DomainError> for ApiError {
impl IntoResponse for ApiError {
fn into_response(self) -> Response {
domain_error_response(self.0)
let status = domain_error_status(&self.0);
match &self.0 {
DomainError::InfrastructureError(_) => {
tracing::error!("Internal error: {:?}", self.0);
(status, axum::Json(serde_json::json!({"error": "internal server error"}))).into_response()
}
_ => (status, axum::Json(serde_json::json!({"error": self.0.to_string()}))).into_response(),
}
}
}