private function handleException(\Throwable $t, Request $request)
    {
        if ($this->log !== null) {
            $this->log->error('Exception thrown inside a controller.', array(
                    'exception' => $t,
            ));
        } else {
            // If no logger is set, let's log in PHP error_log
            error_log($t->getMessage().' - '.$t->getTraceAsString());
        }

        $response = SplashUtils::buildControllerResponse(
            function () use ($t, $request) {
                return $this->errorController->serverError($t, $request);
            }
        );

        return $response;
    }
private function handleException(\Throwable $t, Request $request)
    {
        if ($this->log !== null) {
            $this->log->error('Exception thrown inside a controller.', array(
                    'exception' => $t,
            ));
        } else {
            // If no logger is set, let's log in PHP error_log
            error_log($t->getMessage().' - '.$t->getTraceAsString());
        }

        $response = SplashUtils::buildControllerResponse(
            function () use ($t, $request) {
                return $this->errorController->serverError($t, $request);
            }
        );

        return $response;
    }
private function handleException ( \ Throwable $ t , Request $ request ) { if ( $ this -> log !== null ) { $ this -> log -> error ( 'Exception thrown inside a controller.' , array ( 'exception' => $ t , ) ) ; } else { // If no logger is set, let's log in PHP error_log error_log ( $ t -> getMessage ( ) . ' - ' . $ t -> getTraceAsString ( ) ) ; } $ response = SplashUtils :: buildControllerResponse ( function ( ) use ( $ t , $ request ) { return $ this -> errorController -> serverError ( $ t , $ request ) ; } ) ; return $ response ; }
Actually handle the exception.

@param \Throwable $t
@param Request $request
@return ResponseInterface
Actually handle the exception .