From 49d123ee3ad95286ce7b40ba45c2b3c78993ce77 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 1 Apr 2019 08:04:12 +0200 Subject: [PATCH] src/server/rest.rs: use formatter to encode errors --- src/server/rest.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/rest.rs b/src/server/rest.rs index 44e9943f..1cce06ed 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -573,7 +573,10 @@ pub fn handle_request(api: Arc, req: Request) -> BoxFut { } match api.find_method(&components[2..], method, &mut uri_param) { - MethodDefinition::None => {} + MethodDefinition::None => { + let err = http_err!(NOT_FOUND, "Path not found.".to_string()); + return Box::new(future::ok((formatter.format_error)(err))); + } MethodDefinition::Simple(api_method) => { if api_method.protected && env_type == RpcEnvironmentType::PUBLIC { return proxy_protected_request(api_method, parts, body);