diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/ItemController.php | 9 | ||||
-rw-r--r-- | lib/Service/FeedServiceV2.php | 10 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/Controller/ItemController.php b/lib/Controller/ItemController.php index 4d2050e63..68cebd8c8 100644 --- a/lib/Controller/ItemController.php +++ b/lib/Controller/ItemController.php @@ -180,9 +180,14 @@ class ItemController extends Controller $return['items'] = $this->shareService->mapSharedByDisplayNames($items); // this gets thrown if there are no items - // in that case just return an empty array + // in that case just return an empty response } catch (ServiceException $ex) { - //NO-OP + return [ + 'items' => [], + 'feeds' => [], + 'newestItemId' => null, + 'starred' => 0, + ]; } return $return; diff --git a/lib/Service/FeedServiceV2.php b/lib/Service/FeedServiceV2.php index 16ca9a60a..4668e442a 100644 --- a/lib/Service/FeedServiceV2.php +++ b/lib/Service/FeedServiceV2.php @@ -16,6 +16,7 @@ namespace OCA\News\Service; use DateTime; use FeedIo\Explorer; use FeedIo\Reader\ReadErrorException; +use FeedIo\Reader\NoAccurateParserException; use HTMLPurifier; use OCA\News\Db\FeedMapperV2; @@ -283,10 +284,17 @@ class FeedServiceV2 extends Service $feed->getBasicAuthPassword(), $feed->getHttpLastModified() ); - } catch (ReadErrorException $ex) { + } catch (ReadErrorException | NoAccurateParserException $ex) { $feed->setUpdateErrorCount($feed->getUpdateErrorCount() + 1); $feed->setLastUpdateError($ex->getMessage()); + $this->logger->warning( + 'Error while parsing feed: {url} {error}', + [ + 'url' => $location, + 'error' => $ex + ] + ); return $this->mapper->update($feed); } |