mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
chore(trashbin): refactor deprecated abortOperation to use AbortedEventException
Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
parent
753e6ee442
commit
4b2a77b1ff
1 changed files with 4 additions and 9 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue