1111
1212use OCA \Forms \Db \FormMapper ;
1313use OCA \Forms \Service \CirclesService ;
14+ use OCP \Activity \Exceptions \UnknownActivityException ;
1415use OCP \Activity \IEvent ;
1516use OCP \Activity \IEventMerger ;
1617use OCP \Activity \IProvider ;
@@ -44,12 +45,12 @@ public function __construct(
4445 * @param IEvent $event
4546 * @param IEvent|null $previousEvent
4647 * @return IEvent
47- * @throws \InvalidArgumentException
48+ * @throws UnknownActivityException
4849 */
4950 public function parse ($ language , IEvent $ event , ?IEvent $ previousEvent = null ): IEvent {
5051 // Throw Exception, if not our activity. Necessary for workflow of Activity-App.
5152 if ($ event ->getApp () !== $ this ->appName ) {
52- throw new \ InvalidArgumentException ();
53+ throw new UnknownActivityException ();
5354 }
5455 $ l10n = $ this ->l10nFactory ->get ($ this ->appName , $ language );
5556
@@ -72,7 +73,7 @@ public function parse($language, IEvent $event, ?IEvent $previousEvent = null):
7273 * Provide the translated string with placeholders
7374 * @param $subject The events subject
7475 * @return string
75- * @throws \InvalidArgumentException
76+ * @throws UnknownActivityException
7677 */
7778 public function getSubjectString (IL10N $ l10n , string $ subject ): string {
7879 switch ($ subject ) {
@@ -90,7 +91,7 @@ public function getSubjectString(IL10N $l10n, string $subject): string {
9091
9192 default :
9293 $ this ->logger ->warning ('Some unknown activity has been found: ' . $ subject );
93- throw new \ InvalidArgumentException ();
94+ throw new UnknownActivityException ();
9495 }
9596 }
9697
0 commit comments