From 0557f7705ab12c84e53a5f2dc352557b908af511 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 3 Nov 2011 08:48:20 +0100 Subject: RPC: Do not return an error on 0 results Return an empty array and set the result count to zero instead. Before: $ curl 'http://localhost/rpc.php?type=search&arg=raboof' {"type":"error","resultcount":0,"results":"No results found"} After: $ curl 'http://localhost/rpc.php?type=search&arg=raboof' {"type":"search","resultcount":0,"results":[]} Signed-off-by: Lukas Fleischer --- web/lib/aurjson.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index 4b97d2b3..c1b079a4 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -152,7 +152,7 @@ class AurJSON { return $this->json_results($type, $resultcount, $search_data); } else { - return $this->json_error('No results found'); + return $this->json_results($type, 0, array()); } } -- cgit v1.2.3-24-g4f1b