protected function httpError(HttpExceptionInterface $http_exception, RouteCollection $matched, $methods_matched)
    {
        if (!$this->response->isLocked()) {
            $this->response->code($http_exception->getCode());
        }

        if (!$this->http_error_callbacks->isEmpty()) {
            foreach ($this->http_error_callbacks as $callback) {
                if ($callback instanceof Route) {
                    $this->handleRouteCallback($callback, $matched, $methods_matched);
                } elseif (is_callable($callback)) {
                    if (is_string($callback)) {
                        $callback(
                            $http_exception->getCode(),
                            $this,
                            $matched,
                            $methods_matched,
                            $http_exception
                        );
                    } else {
                        call_user_func(
                            $callback,
                            $http_exception->getCode(),
                            $this,
                            $matched,
                            $methods_matched,
                            $http_exception
                        );
                    }
                }
            }
        }

        // Lock our response, since we probably don't want
        // anything else messing with our error code/body
        $this->response->lock();
    }
protected function httpError(HttpExceptionInterface $http_exception, RouteCollection $matched, $methods_matched)
    {
        if (!$this->response->isLocked()) {
            $this->response->code($http_exception->getCode());
        }

        if (!$this->http_error_callbacks->isEmpty()) {
            foreach ($this->http_error_callbacks as $callback) {
                if ($callback instanceof Route) {
                    $this->handleRouteCallback($callback, $matched, $methods_matched);
                } elseif (is_callable($callback)) {
                    if (is_string($callback)) {
                        $callback(
                            $http_exception->getCode(),
                            $this,
                            $matched,
                            $methods_matched,
                            $http_exception
                        );
                    } else {
                        call_user_func(
                            $callback,
                            $http_exception->getCode(),
                            $this,
                            $matched,
                            $methods_matched,
                            $http_exception
                        );
                    }
                }
            }
        }

        // Lock our response, since we probably don't want
        // anything else messing with our error code/body
        $this->response->lock();
    }
protected function httpError ( HttpExceptionInterface $ http_exception , RouteCollection $ matched , $ methods_matched ) { if ( ! $ this -> response -> isLocked ( ) ) { $ this -> response -> code ( $ http_exception -> getCode ( ) ) ; } if ( ! $ this -> http_error_callbacks -> isEmpty ( ) ) { foreach ( $ this -> http_error_callbacks as $ callback ) { if ( $ callback instanceof Route ) { $ this -> handleRouteCallback ( $ callback , $ matched , $ methods_matched ) ; } elseif ( is_callable ( $ callback ) ) { if ( is_string ( $ callback ) ) { $ callback ( $ http_exception -> getCode ( ) , $ this , $ matched , $ methods_matched , $ http_exception ) ; } else { call_user_func ( $ callback , $ http_exception -> getCode ( ) , $ this , $ matched , $ methods_matched , $ http_exception ) ; } } } } // Lock our response, since we probably don't want // anything else messing with our error code/body $ this -> response -> lock ( ) ; }
Handles an HTTP error exception through our HTTP error callbacks

@param HttpExceptionInterface $http_exception    The exception that occurred
@param RouteCollection $matched                  The collection of routes that were matched in dispatch
@param array $methods_matched                    The HTTP methods that were matched in dispatch
@return void
Handles an HTTP error exception through our HTTP error callbacks