diff options
author | Kévin Gomez <contact@kevingomez.fr> | 2015-10-17 17:45:51 +0200 |
---|---|---|
committer | Kévin Gomez <contact@kevingomez.fr> | 2015-11-11 16:23:49 +0100 |
commit | 1c9cd2a7f03a66a1ae5132ff270e94a7fe6eb9ed (patch) | |
tree | 954a28ce5d6cfa3b24746a6d60943a4de64e3838 /src/Wallabag/CoreBundle/Helper | |
parent | 1dc4e5da2e281ee8acc69ff025c42369cf778387 (diff) | |
download | wallabag-1c9cd2a7f03a66a1ae5132ff270e94a7fe6eb9ed.tar.gz wallabag-1c9cd2a7f03a66a1ae5132ff270e94a7fe6eb9ed.tar.zst wallabag-1c9cd2a7f03a66a1ae5132ff270e94a7fe6eb9ed.zip |
Errors in the automatic tagging do not prevent the entry from being added
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index dc6e1184..3d585e61 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -3,6 +3,7 @@ | |||
3 | namespace Wallabag\CoreBundle\Helper; | 3 | namespace Wallabag\CoreBundle\Helper; |
4 | 4 | ||
5 | use Graby\Graby; | 5 | use Graby\Graby; |
6 | use Psr\Log\LoggerInterface as Logger; | ||
6 | use Wallabag\CoreBundle\Entity\Entry; | 7 | use Wallabag\CoreBundle\Entity\Entry; |
7 | use Wallabag\CoreBundle\Tools\Utils; | 8 | use Wallabag\CoreBundle\Tools\Utils; |
8 | 9 | ||
@@ -14,11 +15,13 @@ class ContentProxy | |||
14 | { | 15 | { |
15 | protected $graby; | 16 | protected $graby; |
16 | protected $tagger; | 17 | protected $tagger; |
18 | protected $logger; | ||
17 | 19 | ||
18 | public function __construct(Graby $graby, RuleBasedTagger $tagger) | 20 | public function __construct(Graby $graby, RuleBasedTagger $tagger, Logger $logger) |
19 | { | 21 | { |
20 | $this->graby = $graby; | 22 | $this->graby = $graby; |
21 | $this->tagger = $tagger; | 23 | $this->tagger = $tagger; |
24 | $this->logger = $logger; | ||
22 | } | 25 | } |
23 | 26 | ||
24 | /** | 27 | /** |
@@ -61,7 +64,14 @@ class ContentProxy | |||
61 | $entry->setPreviewPicture($content['open_graph']['og_image']); | 64 | $entry->setPreviewPicture($content['open_graph']['og_image']); |
62 | } | 65 | } |
63 | 66 | ||
64 | $this->tagger->tag($entry); | 67 | try { |
68 | $this->tagger->tag($entry); | ||
69 | } catch (\Exception $e) { | ||
70 | $this->logger->error('Error while trying to automatically tag an entry.', array( | ||
71 | 'entry_url' => $url, | ||
72 | 'error_msg' => $e->getMessage(), | ||
73 | )); | ||
74 | } | ||
65 | 75 | ||
66 | return $entry; | 76 | return $entry; |
67 | } | 77 | } |