private function handleError($error, Http\Request $request, Http\Response $response)
    {
        $response = $response->withStatus(
            $this->getStatusCode($error, $response)
        );

        $message = $response->getReasonPhrase() ?: 'Unknown Error';
        if (! isset($this->options['env'])
            || $this->options['env'] !== 'production'
        ) {
            $message = $this->createDevelopmentErrorMessage($error);
        }

        $response = $response->end($message);

        $this->triggerError($error, $request, $response);

        return $response;
    }
private function handleError($error, Http\Request $request, Http\Response $response)
    {
        $response = $response->withStatus(
            $this->getStatusCode($error, $response)
        );

        $message = $response->getReasonPhrase() ?: 'Unknown Error';
        if (! isset($this->options['env'])
            || $this->options['env'] !== 'production'
        ) {
            $message = $this->createDevelopmentErrorMessage($error);
        }

        $response = $response->end($message);

        $this->triggerError($error, $request, $response);

        return $response;
    }
private function handleError ( $ error , Http \ Request $ request , Http \ Response $ response ) { $ response = $ response -> withStatus ( $ this -> getStatusCode ( $ error , $ response ) ) ; $ message = $ response -> getReasonPhrase ( ) ? : 'Unknown Error' ; if ( ! isset ( $ this -> options [ 'env' ] ) || $ this -> options [ 'env' ] !== 'production' ) { $ message = $ this -> createDevelopmentErrorMessage ( $ error ) ; } $ response = $ response -> end ( $ message ) ; $ this -> triggerError ( $ error , $ request , $ response ) ; return $ response ; }
Handle an error condition

Use the $error to create details for the response.

@param mixed $error
@param Http\Request $request Request instance.
@param Http\Response $response Response instance.
@return Http\Response
Handle an error condition