X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FEntryRestController.php;h=4801811d63354a659c814f1b41299a9e8821184c;hp=632b16d904d898a59b1421d60c713ee75f3f7c96;hb=4ab0d25f652bdfe184046be6d50afd594709e1a9;hpb=21f78f4d4baae7afaa5845317a9cb52e031f1d1a 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 $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)) {