X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FEntryRestController.php;h=e9e1aca3b2c2d6ea2f08453cc615db659aee1b33;hb=08f29ae7b6af585f3af1dd2f8b01854fb0985668;hp=2c2ec0c106ac1d72073649907f45a634ff7ad2ba;hpb=6fb06904ecde15b1b07d0a2af945338b416cf0e2;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 2c2ec0c1..e9e1aca3 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -199,10 +199,19 @@ class EntryRestController extends WallabagRestController $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId()); if (false === $entry) { - $entry = $this->get('wallabag_core.content_proxy')->updateEntry( - new Entry($this->getUser()), - $url - ); + $entry = new Entry($this->getUser()); + try { + $entry = $this->get('wallabag_core.content_proxy')->updateEntry( + $entry, + $url + ); + } catch (\Exception $e) { + $this->get('logger')->error('Error while saving an entry', [ + 'exception' => $e, + 'entry' => $entry, + ]); + $entry->setUrl($url); + } } if (!is_null($title)) {