We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
AxumNope::Unauthorized
1 parent aaf7ea5 commit cf58d70Copy full SHA for cf58d70
src/web/error.rs
@@ -28,6 +28,8 @@ pub enum AxumNope {
28
VersionNotFound,
29
#[error("Search yielded no results")]
30
NoResults,
31
+ #[error("Unauthorized: {0}")]
32
+ Unauthorized(&'static str),
33
#[error("internal error")]
34
InternalError(anyhow::Error),
35
#[error("bad request")]
@@ -93,6 +95,11 @@ impl AxumNope {
93
95
message: Cow::Owned(source.to_string()),
94
96
status: StatusCode::BAD_REQUEST,
97
}),
98
+ AxumNope::Unauthorized(what) => ErrorResponse::ErrorInfo(ErrorInfo {
99
+ title: "Unauthorized",
100
+ message: what.into(),
101
+ status: StatusCode::UNAUTHORIZED,
102
+ }),
103
AxumNope::InternalError(source) => {
104
crate::utils::report_error(&source);
105
ErrorResponse::ErrorInfo(ErrorInfo {
0 commit comments