Source of file JobErrorHandler.php
Size: 1,056 Bytes - Last Modified: 2021-12-23T10:33:37+00:00
/var/www/docs.ssmods.com/process/src/src/Services/JobErrorHandler.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | <?php namespace Symbiote\QueuedJobs\Services; use Exception; use SilverStripe\Core\Injector\Injectable; /** * Class used to handle errors for a single job */ class JobErrorHandler { use Injectable; public function __construct() { set_error_handler(array($this, 'handleError')); } public function clear() { restore_error_handler(); } public function handleError($errno, $errstr, $errfile, $errline) { if (error_reporting()) { // Don't throw E_DEPRECATED in PHP 5.3+ if (defined('E_DEPRECATED')) { if ($errno == E_DEPRECATED || $errno = E_USER_DEPRECATED) { return; } } switch ($errno) { case E_NOTICE: case E_USER_NOTICE: case E_STRICT: break; default: throw new Exception($errstr . " in $errfile at line $errline", $errno); break; } } } } |