-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(anyhow): allow with error and ok in handlers
- Loading branch information
Showing
9 changed files
with
54 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
//! # Oblivion Default Handler | ||
use super::render::BaseResponse; | ||
use super::{render::BaseResponse, render::Response}; | ||
use crate::utils::parser::OblivionRequest; | ||
use futures::future::{BoxFuture, FutureExt}; | ||
use oblivion_codegen::async_route; | ||
|
||
/// Not Found Handler | ||
/// | ||
/// Handling a non-existent route request. | ||
#[async_route] | ||
pub fn not_found(mut request: OblivionRequest) -> BaseResponse { | ||
BaseResponse::TextResponse( | ||
pub fn not_found(mut request: OblivionRequest) -> Response { | ||
Ok(BaseResponse::TextResponse( | ||
format!( | ||
"Path {} is not found, error with code 404.", | ||
request.get_olps() | ||
), | ||
404, | ||
) | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters