private function handleUnknownError($e)
	{
		$response = $e->getResponse();
		$body = $response->json();

		// switching on the first number of status code
		// we are using floor to round off to the lower end
		// eg. floor(404 / 100) == 4
		switch(floor($response->getStatusCode() / 100))
		{
			// client error (4xx)
			case 4:
				throw new Errors\InvalidRequestError($body['error']['message'], $body['error']['code'], $body['error']['type']);
				break;

			// server error (5xx)
			case 5:
				throw new Errors\ServiceError($body['error']['message'], $body['error']['code'], $body['error']['type']);
				break;

			// very generic error (if all else fails)
			default:
				throw new Errors\Error($body['error']['message'], $body['error']['code'], $body['error']['type']);
		}
	}
private function handleUnknownError($e)
	{
		$response = $e->getResponse();
		$body = $response->json();

		// switching on the first number of status code
		// we are using floor to round off to the lower end
		// eg. floor(404 / 100) == 4
		switch(floor($response->getStatusCode() / 100))
		{
			// client error (4xx)
			case 4:
				throw new Errors\InvalidRequestError($body['error']['message'], $body['error']['code'], $body['error']['type']);
				break;

			// server error (5xx)
			case 5:
				throw new Errors\ServiceError($body['error']['message'], $body['error']['code'], $body['error']['type']);
				break;

			// very generic error (if all else fails)
			default:
				throw new Errors\Error($body['error']['message'], $body['error']['code'], $body['error']['type']);
		}
	}
private function handleUnknownError ( $ e ) { $ response = $ e -> getResponse ( ) ; $ body = $ response -> json ( ) ; // switching on the first number of status code // we are using floor to round off to the lower end // eg. floor(404 / 100) == 4 switch ( floor ( $ response -> getStatusCode ( ) / 100 ) ) { // client error (4xx) case 4 : throw new Errors \ InvalidRequestError ( $ body [ 'error' ] [ 'message' ] , $ body [ 'error' ] [ 'code' ] , $ body [ 'error' ] [ 'type' ] ) ; break ; // server error (5xx) case 5 : throw new Errors \ ServiceError ( $ body [ 'error' ] [ 'message' ] , $ body [ 'error' ] [ 'code' ] , $ body [ 'error' ] [ 'type' ] ) ; break ; // very generic error (if all else fails) default : throw new Errors \ Error ( $ body [ 'error' ] [ 'message' ] , $ body [ 'error' ] [ 'code' ] , $ body [ 'error' ] [ 'type' ] ) ; } }
Handles unknown errors by checking the kind of HTTP status code

@param  GuzzleHttp\Exception\RequestException $e
@return null
@throws Horntell\Errors\InvalidRequestError If HTTP Status Code is 4xx
@throws Horntell\Errors\ServiceError If HTTP Status Code is 5xx
@throws Horntell\Errors\Error If HTTP Status Code is other than 4xx and 5xx
Handles unknown errors by checking the kind of HTTP status code