private function getStatusCode($error, ResponseInterface $response)
    {
        if ($error instanceof \Throwable && ($error->getCode() >= 400 && $error->getCode() <= 599)) {
            return $error->getCode();
        }

        $status = $response->getStatusCode();
        if (! $status || $status < 400 || $status > 599) {
            $status = 500;
        }
        return $status;
    }
private function getStatusCode($error, ResponseInterface $response)
    {
        if ($error instanceof \Throwable && ($error->getCode() >= 400 && $error->getCode() <= 599)) {
            return $error->getCode();
        }

        $status = $response->getStatusCode();
        if (! $status || $status < 400 || $status > 599) {
            $status = 500;
        }
        return $status;
    }
private function getStatusCode ( $ error , ResponseInterface $ response ) { if ( $ error instanceof \ Throwable && ( $ error -> getCode ( ) >= 400 && $ error -> getCode ( ) <= 599 ) ) { return $ error -> getCode ( ) ; } $ status = $ response -> getStatusCode ( ) ; if ( ! $ status || $ status < 400 || $ status > 599 ) { $ status = 500 ; } return $ status ; }
Returns the status code from the error or response

@param unknown $error
@param ResponseInterface $response
@return int
Returns the status code from the error or response