Call the failed method on the job instance.

The event instance and the exception will be passed.

@param  \Exception  $e
@return void
544051
public function failed($e)
    {
        $this->prepareData();

        $handler = Container::getInstance()->make($this->class);

        $parameters = array_merge($this->data, [$e]);

        if (method_exists($handler, 'failed')) {
            call_user_func_array([$handler, 'failed'], $parameters);
        }
    }
1062300
public function handleException(Throwable $e): void
    {
        $exceptionHandlerPath = null;

        if (($module = Application::getCurrentModule()) !== null) {
            $exceptionHandlerPath = Application::getModulePath($module) . 'controllers/ExceptionHandler.php';
            if (!is_file($exceptionHandlerPath)) {
                $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
            }
        } else {
            $exceptionHandlerPath = Application::getApplicationPath('controllers/ExceptionHandler.php');
        }

        if (is_file($exceptionHandlerPath)) {
            require_once $exceptionHandlerPath;
            $exceptionHandler = new \ExceptionHandler($e);

            if ($exceptionHandler instanceof ResponseExceptionHandler) {
                $exceptionHandler->exec();
            } else {
                $routeException = new ServerException('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
                Log::emergency($routeException);
                Application::terminateWithError('Your ExceptionHandler is not instance of ResponseExceptionHandler, can not continue');
            }
        } else {
            $exceptionHandler = new ResponseExceptionHandler($e);
            $exceptionHandler->exec();
        }
    }
772423
protected function handleException(Throwable $e, array $record)
    {
        if (!$this->exceptionHandler) {
            throw $e;
        }

        call_user_func($this->exceptionHandler, $e, $record);
    }
638829
public function renderException(\Exception $e, OutputInterface $output)
    {
        parent::renderException($e, $output);

        if (is_callable($this->exceptionHandler)) {
            try {
                if (method_exists($this->exceptionHandler, '__invoke')) {
                    $this->exceptionHandler->__invoke($e);
                } else {
                    call_user_func($this->exceptionHandler, $e);
                }
            } catch (\Exception $e) {
            }
        }
    }
1167634
public static function exceptionHandler(\Exception $e)
    {
//echo __METHOD__;
        $error = Error::createFromException($e, Response::STATUS_ERROR);
        $status = method_exists($e, 'getStatus') ? $e->getStatus() : Response::STATUS_ERROR;
        Container::get('response')
            ->setStatus($status);
        Container::get('controller')
            ->addError($error)
            ->serve();
    }
1056920
private function handleForConsole(Exception $e)
    {
        if ($e instanceof StopException) {
            $output = $e->getMessage();
        }
        else {
            $data = $this->convertException($e);
            $class = get_class($e);
            $file  = $this->stripFile($data['file']);
            $line  = $data['line'];
            $code  = $data['code'];

            // set the error message
            if ($e instanceof HttpException) {
                $message = http_status_text($data['status']) . ' (' . $data['status'] . ')';
                if (!empty($data['message'])) {
                    $message .=  '. ' . $data['message'];
                }
            }
            else if ($e instanceof QueryException) {
                $message = $data['message'] . '; sql: ' . $data['sql'];
            }
            else {
                $message = $data['message'];
            }

            $output = $class . ' in "' . $file . '", line ' . $line . ':' . PHP_EOL . $message . ' (code ' . $code . ')';
        }

        stdio()->error($output);

        $exitCode = $e->getCode();
        if ($exitCode === null) {
            $exitCode = Command::EXIT_FAILURE;
        }

        exit ($exitCode);
    }
654707
public function _handleException($e)
	{
		if(!$this->_inError && $handler = $this->_application->errorHandler())
		{
			$this->_inError = true;
			$handler->handle($e);
			$this->_inError = false;
		}
		else
		{
			if(php_sapi_name() == 'cli')
			{
				echo $e->__toString();
				exit(1);
			}
			else
			{
				header('HTTP/1.1 500 Internal Server Error');

				echo "<h1>Error: ".$e->getMessage().'</h1>';
				echo '<pre>'.$e->__toString().'</pre>';
				exit(1);
			}
		}
	}
30462
protected function failJob($job, $e)
    {
        if ($job->isDeleted()) {
            return;
        }
        $job->delete();
        $job->failed($e);
    }
1343335
private function handleError($exception)
    {
        if ($this->errorCallback !== null) {
            $callback = $this->errorCallback;
            $callback($exception);
        }
    }
817806
public function report(Exception $e)
    {
        try {
            $this->manager->trackException($e);
        }
        catch (Exception $exception) {
            // ignore
        }

        $this->illuminateHandler->report($e);
    }
51082
public function report( Exception $e )
	{
		if ( !$this->shouldReport( $e ) )
			return;

		try
		{
			$logger = Framework::log();
		}
		catch ( Exception $ex )
		{
			throw $e; // throw the original Exception
		}

		$logger->error( $e );


		$level = $this->getLevel( $e );
		$id = UniversalBuilder::resolveClass( ExceptionIdentifier::class )->identify( $e );

		$logger->{$level}( $e, ['identification' => ['id' => $id]] );
	}
1276555
public function logErrorException(\Exception $e)
    {
        if ($this->getServerContext()->hasLogger(LoggerUtils::SYSTEM)) {
            $this->getServerContext()->getLogger(LoggerUtils::SYSTEM)->error($e->__toString());
        }
    }
814512
protected function handleError(Exception $e)
    {
        if($this->isCli){
            $errorCode = $e->getCode();
            exit((empty($errorCode)) ? 1 : $errorCode);	//exit the program with an error
        }
        else {
            throw new Exception($e->getMessage());
        }
    }
1249990
public function failed($e)
    {
        $this->markAsFailed();

        $payload = $this->payload();

        list($class, $method) = $this->parseJob($payload['job']);

        if (method_exists($this->instance = $this->resolve($class), 'failed')) {
            $this->instance->failed($payload['data'], $e);
        }
    }
911272
public function fail($e = null)
    {
        $this->markAsFailed();

        if ($this->isDeleted()) {
            return;
        }

        try {
            // If the job has failed, we will delete it, call the "failed" method and then call
            // an event indicating the job has failed so it can be logged if needed. This is
            // to allow every developer to better keep monitor of their failed queue jobs.
            $this->delete();

            $this->failed($e);
        } finally {
            $this->resolve(Dispatcher::class)->dispatch(new JobFailed(
                $this->connectionName, $this, $e ?: new ManuallyFailedException
            ));
        }
    }
1078313
public function exceptionHandler($e) : void
    {
        $this->setError(
            (int) $e->getCode(),
            (string) $e->getMessage(),
            (string) $e->getFile(),
            (int) $e->getLine(),
            (string) get_class($e),
            $e->getTrace()
        );

        View::render('500.php', (object) $this->errors);
    }
340649
public function handleException($e)
    {
        if (!$e instanceof Exception) { // Since PHP 7, in addition to an Exception, an internal Error may occur.
            // Convert the Error to ErrorException
            $e = new ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine()); // @codeCoverageIgnore
        } // @codeCoverageIgnore

        $this->getExceptionHandler()->handle($e);
    }