Logs an exeption

@param \Exception $e
@return bool
429358
public function logException(\Exception $e)
    {
        $error = $e->getMessage() . $e->getTraceAsString();
        return $this->logEmergency($error);
    }
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);
    }
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]] );
	}
1296551
public function handleException( \Throwable $e ) : bool
    {
        try{
            // Render exception
            $output = $this->renderer->output( $e );
    
            // make directory
            $dir = $this->file->getParent();
    
            if (!$dir->exists()){
                $dir->makeDirectory();
            }
    
            // output
            $this->file->putContents($output);
        }
        catch(\Throwable $e){
            exit($e->getMessage());
        }
    
        return true;
    }
225836
public function formatException(\Exception $e) {
        $entry = array();

        $entry['class'] = get_class($e);
        $entry['message'] = $e->getMessage();
        $entry['file'] = $e->getFile();
        $entry['line'] = $e->getLine();
        $entry['trace'] = $e->getTraceAsString();

        return $entry;
    }
1342812
protected function shouldReport( Exception $e )
	{
		foreach ( $this->dontReport as $type )
			if ( $e instanceof $type )
				return false;

		return true;
	}
602031
public function logError(MvcEvent $e)
    {
        /** @var \Exception $exception */
        $exception = $e->getResult()->exception;

        if (!$exception) {
            return;
        }

        $extra = [
            'file'  => $exception->getFile(),
            'line'  => $exception->getLine(),
            'trace' => $exception->getTrace()
        ];

        if ($exception instanceof ErrorException) {
            /** @var ErrorException $exception */
            $extra['severity'] = $exception->getSeverity();
        }

        $this->logger->err($exception->getMessage(), $extra);
    }
1284129
protected function doException(\Exception $e)
    {
        $command = new DefaultConsoleCommand();
        $command->data = '"Error #' . $e->getCode() . ' - ' . $e->getMessage() . '"';
        $command->execute();

        $response = (new ResponseInjector)->build();
        $response = $response->withHeader('status', (string)(int)$command->result); // TODO: hack for select cli stream

        $stream = $response->getBody();
        $stream->write($command->message);

        return $response->withBody($stream);
    }
1006849
public function getMessageViaCallback(Exception $e)
    {
        if (is_callable($this->messageCb)) {
            return $this->messageCb->__invoke($e);
        }
        return false;
    }
1119295
public function handle(\Exception $e) {

		try {
			ob_clean();
			$this->createResponse($e)->send();
		}
		
		catch(\Exception $e) {
			printf('Exception thrown when handling exception (%s: %s)', get_class($e), $e->getMessage());
			exit();
		}

	}
45173
public static function errorLog(string $message, \Exception $exception)
    {
        $logger = Config::getLogger();
        if ($logger) {
            $logger->error($message, ['exception' => $exception]);
        }
    }
506024
public static function exception_handler(\Exception $e)
	{
		if (method_exists($e, 'handle'))
		{
			return $e->handle();
		}

		$severity = ( ! isset(static::$levels[$e->getCode()])) ? $e->getCode() : static::$levels[$e->getCode()];
		logger(\Fuel::L_ERROR, $severity.' - '.$e->getMessage().' in '.$e->getFile().' on line '.$e->getLine());

		if (\Fuel::$env != \Fuel::PRODUCTION)
		{
			static::show_php_error($e);
		}
		else
		{
			static::show_production_error($e);
		}
	}
99373
public function handle(Exception $ex) {
        if ( ! $this->supports($ex)) {
            return false;
        }

        $handled = $this->invokeHandler($this->getHandler(), $ex);

        return $handled === true ? true : false;
    }
579180
public function report(Exception $e, array $extra = [])
    {
        $this->log->error((string) $e, $extra);
    }
761953
protected static function assertFalseException(\Exception $e): bool
    {
        $msg = 'EXCEPTION: ' . $e->getMessage();
        $msg .= "\n    " . $e->getFile() . ' ('  . $e->getLine() . ')';
        self::assert(false, $msg);
    }
407601
public function exception($e)
    {
        $this->setParams(
            $e->getCode(),
            $e->getMessage(),
            $e->getFile(),
            $e->getLine(),
            $e->getTraceAsString());

        return $this->render();
    }
1047008
protected function error(\Exception $e)
    {
        $str  = sprintf("Message: %s\r\n", $e->getMessage());
        $str .= sprintf("Code: %s\r\n", $e->getCode());
        $str .= sprintf("File: %s (line: %s)\r\n", $e->getFile(), $e->getLine());
        $str .= sprintf("Trade: %s\r\n", $e->getTraceAsString());

        if ($this->log instanceof \Closure)
        {
            $log = $this->log;
            $log($str);
        }
    }