Skip to content

Commit 3ba2a0f

Browse files
committed
web/error: add AxumNope::MissingAuthenticationToken
1 parent 041c702 commit 3ba2a0f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/web/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ pub enum AxumNope {
2828
VersionNotFound,
2929
#[error("Search yielded no results")]
3030
NoResults,
31+
#[error("Missing authentication token")]
32+
MissingAuthenticationToken,
3133
#[error("Invalid authentication token")]
3234
InvalidAuthenticationToken,
3335
#[error("internal error")]
@@ -95,6 +97,11 @@ impl AxumNope {
9597
message: Cow::Owned(source.to_string()),
9698
status: StatusCode::BAD_REQUEST,
9799
}),
100+
AxumNope::MissingAuthenticationToken => ErrorResponse::ErrorInfo(ErrorInfo {
101+
title: "Missing authentication token",
102+
message: "The token used for authentication is missing".into(),
103+
status: StatusCode::UNAUTHORIZED,
104+
}),
98105
AxumNope::InvalidAuthenticationToken => ErrorResponse::ErrorInfo(ErrorInfo {
99106
title: "Invalid authentication token",
100107
message: "The token used for authentication is not valid".into(),

0 commit comments

Comments
 (0)