bolt/bolt — pull request #1689 by GawainLynch (2014-09-04 07:30:38+00:00)
Title: Cron exception handling

Cron jobs will now handle errors gracefully and not halt other cron dispatchers:

```
Running Cron Hourly Jobs
Running Cron Daily Jobs
Running Cron Weekly Jobs
Clearing cache
Trimming logs
Running Cron Monthly Jobs
Starting AmazonBooks record update
A cron.Monthly job failed. The exception returned was:
Accessed request service outside of request scope. Try moving that call to a before handler or controller.
Backtrace:
#0 /var/www/sites/example.com/vendor/pimple/pimple/lib/Pimple.php(83): Silex\Application->Silex\{closure}(Object(Bolt\Application))
#1 /var/www/sites/example.com/app/src/Bolt/Storage.php(1399): Pimple->offsetGet('request')
#2 /var/www/sites/example.com/app/src/Bolt/Storage.php(1650): Bolt\Storage->organizeQueryParameters('')
#3 /var/www/sites/example.com/app/src/Bolt/Storage.php(1979): Bolt\Storage->decodeContentQuery('books', '')
#4 /var/www/sites/example.com/extensions/vendor/popanth/amazonbooks/Extension.php(72): Bolt\Storage->getContent('books')
#5 [internal function]: Bolt\Extension\PopAnth\AmazonBooks\Extension->cronMonthly(Object(Bolt\CronEvent), 'cron.Monthly', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#6 /var/www/sites/example.com/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Bolt\CronEvent), 'cron.Monthly', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#7 /var/www/sites/example.com/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(53): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'cron.Monthly', Object(Bolt\CronEvent))
#8 /var/www/sites/example.com/app/src/Bolt/Controllers/Cron.php(100): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('cron.Monthly', Object(Bolt\CronEvent))
#9 /var/www/sites/example.com/app/src/Bolt/Controllers/Cron.php(56): Bolt\Controllers\Cron->execute()
#10 /var/www/sites/example.com/app/src/Bolt/Nut/CronRunner.php(36): Bolt\Controllers\Cron->__construct(Object(Bolt\Application), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/sites/example.com/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(252): Bolt\Nut\CronRunner->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/sites/example.com/vendor/symfony/console/Symfony/Component/Console/Application.php(889): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/sites/example.com/vendor/symfony/console/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(Bolt\Nut\CronRunner), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/sites/example.com/vendor/symfony/console/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/sites/example.com/app/nut(30): Symfony\Component\Console\Application->run()
#16 {main}
Running Cron Yearly Jobs
Cron run!
```