private function assignExceptions(RequestException $ex)
    {
        if ($ex->hasResponse() && $ex->getResponse()->getStatusCode() == 401) {
            throw new TokenExpiredException('Salesforce token has expired', $ex);
        } elseif ($ex->hasResponse()) {
            throw new SalesforceException('Salesforce response error: '.$ex->getMessage(), $ex);
        } else {
            throw new SalesforceException('Invalid request: %s', $ex);
        }
    }
private function assignExceptions(RequestException $ex)
    {
        if ($ex->hasResponse() && $ex->getResponse()->getStatusCode() == 401) {
            throw new TokenExpiredException('Salesforce token has expired', $ex);
        } elseif ($ex->hasResponse()) {
            throw new SalesforceException('Salesforce response error: '.$ex->getMessage(), $ex);
        } else {
            throw new SalesforceException('Invalid request: %s', $ex);
        }
    }
private function assignExceptions ( RequestException $ ex ) { if ( $ ex -> hasResponse ( ) && $ ex -> getResponse ( ) -> getStatusCode ( ) == 401 ) { throw new TokenExpiredException ( 'Salesforce token has expired' , $ ex ) ; } elseif ( $ ex -> hasResponse ( ) ) { throw new SalesforceException ( 'Salesforce response error: ' . $ ex -> getMessage ( ) , $ ex ) ; } else { throw new SalesforceException ( 'Invalid request: %s' , $ ex ) ; } }
Method will elaborate on RequestException.

@param RequestException $ex

@throws SalesforceException
@throws TokenExpiredException
Method will elaborate on RequestException .