diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2020-01-13 14:54:19 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2020-01-13 14:54:19 +0300 |
commit | 2e9fa7a9f8f404925a3142ba7cd379a635c3a4e9 (patch) | |
tree | 2da24a717741be1ebf5d65b7d9522f232638e489 /lib/Model/Runner.php | |
parent | 390f717d66c8d66c8e26833847cab40dd2d0df56 (diff) |
cleaning code
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model/Runner.php')
-rw-r--r-- | lib/Model/Runner.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Model/Runner.php b/lib/Model/Runner.php index 19f4eb1..b0c82dd 100644 --- a/lib/Model/Runner.php +++ b/lib/Model/Runner.php @@ -32,6 +32,7 @@ namespace OCA\FullTextSearch\Model; use daita\MySmallPhpTools\Traits\TArrayTools; +use Exception; use OCA\FullTextSearch\ACommandBase; use OCA\FullTextSearch\Exceptions\RunnerAlreadyUpException; use OCA\FullTextSearch\Exceptions\TickDoesNotExistException; @@ -139,7 +140,7 @@ class Runner implements IRunner { * @param bool $force * * @return string - * @throws \Exception + * @throws Exception */ public function updateAction(string $action = '', bool $force = false): string { @@ -398,7 +399,7 @@ class Runner implements IRunner { /** - * @deprecated - verifier l'interet !? + * // TODO: finalize this exception handling about error logs. * * @param string $reason * @param bool $stop @@ -407,8 +408,14 @@ class Runner implements IRunner { if (!$stop) { $this->output('Exception: ' . $reason); // TODO: feed an array of exceptions for log; + } else { + try { + $this->runningService->stop($this->tickId, $reason); + } catch (TickDoesNotExistException $e) { + /** exception will be managed somewhere else */ + // TODO: Check if above statement is correct. + } } - $this->runningService->exception($this->tickId, $reason, $stop); } |