diff options
author | Benjamin Brahmer <info@b-brahmer.de> | 2020-10-29 08:21:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 08:21:01 +0100 |
commit | cfc75fb1d38318245abfc341939ef80cab0b0683 (patch) | |
tree | 03e575779248c7a2b2e75641f7225ceb6bdbfc76 /lib/Command/ShowFeed.php | |
parent | ec6930da8226b9879eb2d7289af739aa96de43ef (diff) | |
parent | c5daf112bed9d958f70073fd1cb199beff322334 (diff) |
Merge branch 'master' into fix/dont_overload_getid
Diffstat (limited to 'lib/Command/ShowFeed.php')
-rw-r--r-- | lib/Command/ShowFeed.php | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/Command/ShowFeed.php b/lib/Command/ShowFeed.php index 8aace3528..0016470e6 100644 --- a/lib/Command/ShowFeed.php +++ b/lib/Command/ShowFeed.php @@ -10,18 +10,7 @@ */ namespace OCA\News\Command; -use FeedIo\FeedIo; -use Favicon\Favicon; - -use HTMLPurifier; -use OCA\News\Db\FeedMapper; -use OCA\News\Db\ItemMapper; use OCA\News\Fetcher\Fetcher; -use OCA\News\Service\FeedService; -use OCA\News\Utility\Time; -use OCP\IConfig; -use OCP\IL10N; -use OCP\ILogger; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputArgument; @@ -80,13 +69,15 @@ class ShowFeed extends Command try { list($feed, $items) = $this->feedFetcher->fetch($url, true, null, $fullTextEnabled, $user, $password); - $output->writeln("Feed: " . json_encode($feed, JSON_PRETTY_PRINT)); - $output->writeln("Items: " . json_encode($items, JSON_PRETTY_PRINT)); - return 0; - } catch (\Throwable $ex) { + } catch (\Exception $ex) { $output->writeln('<error>Failed to fetch feed info:</error>'); $output->writeln($ex->getMessage()); return 1; } + + $output->writeln("Feed: " . json_encode($feed, JSON_PRETTY_PRINT)); + $output->writeln("Items: " . json_encode($items, JSON_PRETTY_PRINT)); + + return 0; } } |