src/mako/error/ErrorHandler.php
public function handler(Throwable $exception): void
	{
		try
		{
			// Empty output buffers

			$this->clearOutputBuffers();

			// Loop through the exception handlers

			foreach($this->handlers as $handler)
			{
				if($exception instanceof $handler['exceptionType'])
				{
					if($this->handleException($handler['handler'], $exception) !== null)
					{
						break;
					}
				}
			}

			// Log exception

			if($this->shouldExceptionBeLogged($exception))
			{
				$this->getLogger()->error($exception->getMessage(), ['exception' => $exception]);
			}
		}
		catch(Throwable $e)
		{
			// Empty output buffers

			$this->clearOutputBuffers();

			// One of the exception handlers failed so we'll just show the user a generic error screen

			echo $e->getMessage() . ' on line [ ' . $e->getLine() . ' ] in [ ' . $e->getFile() . ' ]' . PHP_EOL;
		}

		exit(1);
	}
public function handler(Throwable $exception): void
	{
		try
		{
			// Empty output buffers

			$this->clearOutputBuffers();

			// Loop through the exception handlers

			foreach($this->handlers as $handler)
			{
				if($exception instanceof $handler['exceptionType'])
				{
					if($this->handleException($handler['handler'], $exception) !== null)
					{
						break;
					}
				}
			}

			// Log exception

			if($this->shouldExceptionBeLogged($exception))
			{
				$this->getLogger()->error($exception->getMessage(), ['exception' => $exception]);
			}
		}
		catch(Throwable $e)
		{
			// Empty output buffers

			$this->clearOutputBuffers();

			// One of the exception handlers failed so we'll just show the user a generic error screen

			echo $e->getMessage() . ' on line [ ' . $e->getLine() . ' ] in [ ' . $e->getFile() . ' ]' . PHP_EOL;
		}

		exit(1);
	}
public function handler ( Throwable $ exception ) : void { try { // Empty output buffers $ this -> clearOutputBuffers ( ) ; // Loop through the exception handlers foreach ( $ this -> handlers as $ handler ) { if ( $ exception instanceof $ handler [ 'exceptionType' ] ) { if ( $ this -> handleException ( $ handler [ 'handler' ] , $ exception ) !== null ) { break ; } } } // Log exception if ( $ this -> shouldExceptionBeLogged ( $ exception ) ) { $ this -> getLogger ( ) -> error ( $ exception -> getMessage ( ) , [ 'exception' => $ exception ] ) ; } } catch ( Throwable $ e ) { // Empty output buffers $ this -> clearOutputBuffers ( ) ; // One of the exception handlers failed so we'll just show the user a generic error screen echo $ e -> getMessage ( ) . ' on line [ ' . $ e -> getLine ( ) . ' ] in [ ' . $ e -> getFile ( ) . ' ]' . PHP_EOL ; } exit ( 1 ) ; }
Handles uncaught exceptions.

@param \Throwable $exception An exception object
Handles uncaught exceptions .