cron: exit 1 on exception

Allows the caller to more easily respond to cron failures.

Signed-off-by: Stephen Michel <git@smichel.me>
This commit is contained in:
smichel17 2021-07-18 15:06:45 +00:00 committed by Stephen Michel
parent 27847a9250
commit 84d3a5f8e6
1 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@
* @author Steffen Lindner <mail@steffen-lindner.de>
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Vincent Petry <vincent@nextcloud.com>
* @author Stephen Michel <git@smichel.me>
*
* @license AGPL-3.0
*
@ -158,6 +159,8 @@ try {
exit();
} catch (Exception $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'cron']);
exit(1);
} catch (Error $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'cron']);
exit(1);
}