src/server/rest.rs: improve error handling

This commit is contained in:
Dietmar Maurer 2019-05-23 08:15:32 +02:00
parent 907f5bb0d8
commit 1179e15842
1 changed files with 5 additions and 2 deletions

View File

@ -258,6 +258,9 @@ pub fn handle_sync_api_request<Env: RpcEnvironment>(
} else {
Either::B(future::ok(resp))
}
})
.or_else(move |err| {
Ok((formatter.format_error)(err))
});
Box::new(resp)