Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ocs
diff options
context:
space:
mode:
Diffstat (limited to 'ocs')
-rw-r--r--ocs/v1.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/ocs/v1.php b/ocs/v1.php
index d596a1b0fd3..9f6a05ac42f 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -79,7 +79,13 @@ try {
OC_API::setContentType();
$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.'."\n";
- OC_API::respond(new \OC\OCS\Result(null, \OCP\AppFramework\OCSController::RESPOND_NOT_FOUND, $txt), $format);
+ $txt = 'Internal Server Error'."\n";
+ try {
+ if (\OC::$server->getSystemConfig()->getValue('debug', false)) {
+ $txt .= $e->getMessage();
+ }
+ } catch (\Throwable $e) {
+ // Just to be save
+ }
+ OC_API::respond(new \OC\OCS\Result(null, \OCP\AppFramework\OCSController::RESPOND_SERVER_ERROR, $txt), $format);
}