/**
  * Handle server error exceptions
  * 
  * @param \GuzzleHttp\Exception\ServerException $exc
  * @throws \WalmartApiClient\Exception\ApiBadGatewayException
  * @throws \WalmartApiClient\Exception\ApiServiceUnavailableException
  * @throws \WalmartApiClient\Exception\ApiGatewayTimeoutException
  * @throws \WalmartApiClient\Exception\ApiInternalServerErrorException
  */
 protected function handleServerException(\GuzzleHttp\Exception\ServerException $exc)
 {
     if ($exc->hasResponse() && $exc->getResponse()->getStatusCode() !== null) {
         $code = $exc->getResponse()->getStatusCode();
         switch ($code) {
             case 502:
                 throw new \WalmartApiClient\Exception\ApiBadGatewayException('Bad gateway', $code);
             case 503:
                 throw new \WalmartApiClient\Exception\ApiServiceUnavailableException('Service unavailable', $code);
             case 504:
                 throw new \WalmartApiClient\Exception\ApiGatewayTimeoutException('Gateway timeout', $code);
         }
     }
     throw new \WalmartApiClient\Exception\ApiInternalServerErrorException('Internal server error', 500);
 }