From 4b2a77b1ff48b4d6fa8e0865df173e5b774214e9 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 18 Mar 2026 09:46:54 -0400 Subject: [PATCH] chore(trashbin): refactor deprecated abortOperation to use AbortedEventException Signed-off-by: Josh --- .../lib/Events/BeforeNodeRestoredEvent.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php b/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php index 0bc6b37c35b..405d9b6396e 100644 --- a/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php +++ b/apps/files_trashbin/lib/Events/BeforeNodeRestoredEvent.php @@ -8,7 +8,7 @@ declare(strict_types=1); */ namespace OCA\Files_Trashbin\Events; -use Exception; +use OCP\Exceptions\AbortedEventException; use OCP\Files\Events\Node\AbstractNodesEvent; use OCP\Files\Node; @@ -25,15 +25,10 @@ class BeforeNodeRestoredEvent extends AbstractNodesEvent { } /** - * @return never + * @since 28.0.0 + * @deprecated 29.0.0 - use OCP\Exceptions\AbortedEventException instead */ public function abortOperation(?\Throwable $ex = null) { - $this->stopPropagation(); - $this->run = false; - if ($ex !== null) { - throw $ex; - } else { - throw new Exception('Operation aborted'); - } + throw new AbortedEventException($ex?->getMessage() ?? 'Operation aborted'); } }