From 6174a514b76f2e1c32c6fce6de6a23cfac414558 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 3 Mar 2017 00:41:21 -0600 Subject: Get rid of static OCS::notFound() Signed-off-by: Morris Jobke --- ocs/v1.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ocs/v1.php') diff --git a/ocs/v1.php b/ocs/v1.php index 2c83144da6f..e92250b7e38 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -80,7 +80,11 @@ try { OC::$server->getRouter()->match('/ocsapp'.\OC::$server->getRequest()->getRawPathInfo()); } catch (ResourceNotFoundException $e) { OC_API::setContentType(); - OC_OCS::notFound(); + + $format = \OC::$server->getRequest()->getParam('format', 'xml'); + $txt='Invalid query, please check the syntax. API specifications are here:' + .' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n"; + OC_API::respond(new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, $txt), $format); } catch (MethodNotAllowedException $e) { OC_API::setContentType(); OC_Response::setStatus(405); @@ -91,6 +95,10 @@ try { } catch (\Exception $e) { \OC::$server->getLogger()->logException($e); OC_API::setContentType(); - OC_OCS::notFound(); + + $format = \OC::$server->getRequest()->getParam('format', 'xml'); + $txt='Invalid query, please check the syntax. API specifications are here:' + .' http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n"; + OC_API::respond(new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, $txt), $format); } -- cgit v1.2.3