src/Common/Internal/Http/HttpClient.php
public static function throwIfError($actual, $reason, $message, array $expected)
    {
        if (!in_array($actual, $expected)) {
            throw new ServiceException($actual, $reason, $message);
        }
    }
public static function throwIfError($actual, $reason, $message, array $expected)
    {
        if (!in_array($actual, $expected)) {
            throw new ServiceException($actual, $reason, $message);
        }
    }
public static function throwIfError ( $ actual , $ reason , $ message , array $ expected ) { if ( ! in_array ( $ actual , $ expected ) ) { throw new ServiceException ( $ actual , $ reason , $ message ) ; } }
Throws ServiceException if the received status code is not expected.

@param string $actual   The received status code
@param string $reason   The reason phrase
@param string $message  The detailed message (if any)
@param array  $expected The expected status codes

@throws ServiceException
Throws ServiceException if the received status code is not expected .