aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2024-09-16 15:09:39 +0200
committerAnna Larch <anna@nextcloud.com>2024-09-17 12:06:24 +0200
commit1ce46c1fca9797bb2bd5c160c5976eeec828ae32 (patch)
tree1a239cffc8f412e2ad1f5c637905f4acb119069d /apps/files
parent4e64a6eb48dc5ba5bf3e31c1f58b1fcf710e255b (diff)
downloadnextcloud-server-1ce46c1fca9797bb2bd5c160c5976eeec828ae32.tar.gz
nextcloud-server-1ce46c1fca9797bb2bd5c160c5976eeec828ae32.zip
refactor: move to new activity exceptionrefactor/move-to-new-activity-exception
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/lib/Activity/FavoriteProvider.php5
-rw-r--r--apps/files/lib/Activity/Provider.php5
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php
index 00f1387df94..8cfc1a83798 100644
--- a/apps/files/lib/Activity/FavoriteProvider.php
+++ b/apps/files/lib/Activity/FavoriteProvider.php
@@ -5,6 +5,7 @@
*/
namespace OCA\Files\Activity;
+use OCP\Activity\Exceptions\UnknownActivityException;
use OCP\Activity\IEvent;
use OCP\Activity\IEventMerger;
use OCP\Activity\IManager;
@@ -50,12 +51,12 @@ class FavoriteProvider implements IProvider {
* @param IEvent $event
* @param IEvent|null $previousEvent
* @return IEvent
- * @throws \InvalidArgumentException
+ * @throws UnknownActivityException
* @since 11.0.0
*/
public function parse($language, IEvent $event, ?IEvent $previousEvent = null) {
if ($event->getApp() !== 'files' || $event->getType() !== 'favorite') {
- throw new \InvalidArgumentException();
+ throw new UnknownActivityException();
}
$this->l = $this->languageFactory->get('files', $language);
diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php
index aa3ef062a16..f777d11c02e 100644
--- a/apps/files/lib/Activity/Provider.php
+++ b/apps/files/lib/Activity/Provider.php
@@ -5,6 +5,7 @@
*/
namespace OCA\Files\Activity;
+use OCP\Activity\Exceptions\UnknownActivityException;
use OCP\Activity\IEvent;
use OCP\Activity\IEventMerger;
use OCP\Activity\IManager;
@@ -79,12 +80,12 @@ class Provider implements IProvider {
* @param IEvent $event
* @param IEvent|null $previousEvent
* @return IEvent
- * @throws \InvalidArgumentException
+ * @throws UnknownActivityException
* @since 11.0.0
*/
public function parse($language, IEvent $event, ?IEvent $previousEvent = null) {
if ($event->getApp() !== 'files') {
- throw new \InvalidArgumentException();
+ throw new UnknownActivityException();
}
$this->l = $this->languageFactory->get('files', $language);