api/router.rs: return Result in upload handler

This commit is contained in:
Dietmar Maurer
2019-01-17 12:03:38 +01:00
parent 23bb8780d4
commit 0ee0ad5bf3
3 changed files with 12 additions and 5 deletions

View File

@ -208,7 +208,13 @@ fn handle_upload_api_request(
}
};
(info.handler)(req_body, params, info)
match (info.handler)(req_body, params, info) {
Ok(future) => future,
Err(err) => {
let resp = (formatter.format_result)(Err(Error::from(err)));
Box::new(future::ok(resp))
}
}
}
fn get_index() -> BoxFut {