protected function handleRequestException(Request $request, RequestException $previousException)
    {
        if (null !== $previousException) {
            $response = $previousException->getResponse();

            if (null == $response || ($response->getStatusCode() >= 500 && $response->getStatusCode() <= 599)) {
                throw new NullResponseException($this->request, $previousException);
            }
        }

        throw $this->createApiException(
            $request,
            $this->createResponse($previousException->getResponse()),
            $previousException
        );
    }
protected function handleRequestException(Request $request, RequestException $previousException)
    {
        if (null !== $previousException) {
            $response = $previousException->getResponse();

            if (null == $response || ($response->getStatusCode() >= 500 && $response->getStatusCode() <= 599)) {
                throw new NullResponseException($this->request, $previousException);
            }
        }

        throw $this->createApiException(
            $request,
            $this->createResponse($previousException->getResponse()),
            $previousException
        );
    }
protected function handleRequestException ( Request $ request , RequestException $ previousException ) { if ( null !== $ previousException ) { $ response = $ previousException -> getResponse ( ) ; if ( null == $ response || ( $ response -> getStatusCode ( ) >= 500 && $ response -> getStatusCode ( ) <= 599 ) ) { throw new NullResponseException ( $ this -> request , $ previousException ) ; } } throw $ this -> createApiException ( $ request , $ this -> createResponse ( $ previousException -> getResponse ( ) ) , $ previousException ) ; }
Create the request exception

@param  Request                          $request
@param  RequestException|null            $previousException
@throws \Tmdb\Exception\TmdbApiException
Create the request exception