chore(trashbin): refactor deprecated abortOperation to use AbortedEventException

Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
Josh 2026-03-18 09:46:54 -04:00
parent 753e6ee442
commit 4b2a77b1ff

View file

@ -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');
}
}