aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Activity/Manager.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-04-17 15:29:33 +0200
committerJoas Schilling <coding@schilljs.com>2024-04-17 15:36:42 +0200
commit9f4845e25b32b8244d8f1e5255cd325adc37cd78 (patch)
tree051f847d3ff92379fac38483f553f4ccd40a07a2 /lib/private/Activity/Manager.php
parent784ab6e79abdc802b30c4290729737f3ed17f73c (diff)
downloadnextcloud-server-9f4845e25b32b8244d8f1e5255cd325adc37cd78.tar.gz
nextcloud-server-9f4845e25b32b8244d8f1e5255cd325adc37cd78.zip
fix(activity): Add a dedicated exception when the filter or setting is not found
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Activity/Manager.php')
-rw-r--r--lib/private/Activity/Manager.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php
index 3458ea041c3..7f95771294a 100644
--- a/lib/private/Activity/Manager.php
+++ b/lib/private/Activity/Manager.php
@@ -29,7 +29,9 @@
namespace OC\Activity;
use OCP\Activity\ActivitySettings;
+use OCP\Activity\Exceptions\FilterNotFoundException;
use OCP\Activity\Exceptions\IncompleteActivityException;
+use OCP\Activity\Exceptions\SettingNotFoundException;
use OCP\Activity\IConsumer;
use OCP\Activity\IEvent;
use OCP\Activity\IFilter;
@@ -198,10 +200,7 @@ class Manager implements IManager {
}
/**
- * @param string $id
- * @return IFilter
- * @throws \InvalidArgumentException when the filter was not found
- * @since 11.0.0
+ * {@inheritDoc}
*/
public function getFilterById(string $id): IFilter {
$filters = $this->getFilters();
@@ -210,7 +209,7 @@ class Manager implements IManager {
return $filters[$id];
}
- throw new \InvalidArgumentException('Requested filter does not exist');
+ throw new FilterNotFoundException($id);
}
/** @var string[] */
@@ -286,10 +285,7 @@ class Manager implements IManager {
}
/**
- * @param string $id
- * @return ActivitySettings
- * @throws \InvalidArgumentException when the setting was not found
- * @since 11.0.0
+ * {@inheritDoc}
*/
public function getSettingById(string $id): ActivitySettings {
$settings = $this->getSettings();
@@ -298,7 +294,7 @@ class Manager implements IManager {
return $settings[$id];
}
- throw new \InvalidArgumentException('Requested setting does not exist');
+ throw new SettingNotFoundException($id);
}