Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/Controller/BookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -332,15 +334,17 @@ 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 {
try {
$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);
}
}
Expand Down
Loading