refactor error handling

This commit is contained in:
Nikolay Kim 2017-11-15 20:06:28 -10:00
parent c565965865
commit de71ad7de4
18 changed files with 317 additions and 325 deletions

View file

@ -19,7 +19,8 @@ fn index(req: &mut HttpRequest, mut _payload: Payload, state: &()) -> HttpRespon
}
/// somple handle
fn index_async(req: &mut HttpRequest, _payload: Payload, state: &()) -> Once<actix_web::Frame, ()>
fn index_async(req: &mut HttpRequest, _payload: Payload, state: &())
-> Once<actix_web::Frame, actix_web::error::Error>
{
println!("{:?}", req);
@ -49,7 +50,7 @@ fn main() {
HttpServer::new(
Application::default("/")
// enable logger
.middleware(middlewares::Logger::default())
//.middleware(middlewares::Logger::default())
// register simple handle r, handle all methods
.handler("/index.html", index)
// with path parameters