aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/EntryRestController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/EntryRestController.php')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 632b16d9..4801811d 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -297,10 +297,19 @@ class EntryRestController extends WallabagRestController
297 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId()); 297 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
298 298
299 if (false === $entry) { 299 if (false === $entry) {
300 $entry = $this->get('wallabag_core.content_proxy')->updateEntry( 300 $entry = new Entry($this->getUser());
301 new Entry($this->getUser()), 301 try {
302 $url 302 $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
303 ); 303 $entry,
304 $url
305 );
306 } catch (\Exception $e) {
307 $this->get('logger')->error('Error while saving an entry', [
308 'exception' => $e,
309 'entry' => $entry,
310 ]);
311 $entry->setUrl($url);
312 }
304 } 313 }
305 314
306 if (!is_null($title)) { 315 if (!is_null($title)) {