diff --git a/lib/Controller/BookmarkController.php b/lib/Controller/BookmarkController.php index 7c20fa865..ea3340d2f 100644 --- a/lib/Controller/BookmarkController.php +++ b/lib/Controller/BookmarkController.php @@ -316,12 +316,14 @@ public function getBookmarks( $res = new DataResponse(['status' => 'error', 'data' => ['Not found']], Http::STATUS_BAD_REQUEST); $res->throttle(); return $res; - } catch (\OCP\DB\Exception) { + } catch (\OCP\DB\Exception $e) { + $this->logger->error($e->getMessage(), ['exception' => $e]); return new DataResponse(['status' => 'error', 'data' => ['Internal error']], Http::STATUS_INTERNAL_SERVER_ERROR); } try { $params->setFolder($this->toInternalFolderId($folder)); - } catch (\OCP\DB\Exception) { + } catch (\OCP\DB\Exception $e) { + $this->logger->error($e->getMessage(), ['exception' => $e]); return new DataResponse(['status' => 'error', 'data' => ['Internal error']], Http::STATUS_INTERNAL_SERVER_ERROR); } $params->setRecursive($recursive); @@ -332,7 +334,8 @@ public function getBookmarks( $result = $this->bookmarkMapper->findAll($userId, $params); } catch (UrlParseError) { return new DataResponse(['status' => 'error', 'data' => ['Failed to parse URL']], Http::STATUS_BAD_REQUEST); - } catch (\OCP\DB\Exception) { + } catch (\OCP\DB\Exception $e) { + $this->logger->error($e->getMessage(), ['exception' => $e]); return new DataResponse(['status' => 'error', 'data' => ['Internal error']], Http::STATUS_INTERNAL_SERVER_ERROR); } } else { @@ -340,7 +343,8 @@ public function getBookmarks( $result = $this->bookmarkMapper->findAllInPublicFolder($this->authorizer->getToken(), $params); } catch (DoesNotExistException|MultipleObjectsReturnedException) { return new DataResponse(['status' => 'error', 'data' => ['Not found']], Http::STATUS_BAD_REQUEST); - } catch (\OCP\DB\Exception) { + } catch (\OCP\DB\Exception $e) { + $this->logger->error($e->getMessage(), ['exception' => $e]); return new DataResponse(['status' => 'error', 'data' => ['Internal error']], Http::STATUS_INTERNAL_SERVER_ERROR); } }