MCPcopy Create free account
hub / github.com/ZingerLittleBee/ServerBee / into_response

Method into_response

crates/server/src/error.rs:73–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

71
72impl 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
92impl IntoResponse for AppError {
93 fn into_response(self) -> Response {

Calls

no outgoing calls

Tested by

no test coverage detected