(self)
| 71 | |
| 72 | impl AppError { |
| 73 | /// Bare error message for audit-log `deny_reason` details (no status-code |
| 74 | /// prefix). `None` for `Unauthorized`, which is deliberately opaque. |
| 75 | pub fn audit_reason(&self) -> Option<&str> { |
| 76 | match self { |
| 77 | AppError::Forbidden(message) |
| 78 | | AppError::BadRequest(message) |
| 79 | | AppError::NotFound(message) |
| 80 | | AppError::Conflict(message) |
| 81 | | AppError::RequestTimeout(message) |
| 82 | | AppError::Validation(message) |
| 83 | | AppError::TooManyRequests(message) |
| 84 | | AppError::BadGateway(message) |
| 85 | | AppError::Internal(message) => Some(message.as_str()), |
| 86 | AppError::Unauthorized => None, |
| 87 | AppError::Domain { message, .. } => Some(message.as_str()), |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | impl IntoResponse for AppError { |
| 93 | fn into_response(self) -> Response { |
no outgoing calls
no test coverage detected