private function handleCurlError($url, $errno, $message)
{
switch ($errno) {
case CURLE_COULDNT_CONNECT:
case CURLE_COULDNT_RESOLVE_HOST:
case CURLE_OPERATION_TIMEOUTED:
$msg = "Could not connect to Stripe ({$url}). Please check your " . "internet connection and try again. If this problem persists, " . "you should check Stripe's service status at " . "https://twitter.com/stripestatus, or";
break;
case CURLE_SSL_CACERT:
case CURLE_SSL_PEER_CERTIFICATE:
$msg = "Could not verify Stripe's SSL certificate. Please make sure " . "that your network is not intercepting certificates. " . "(Try going to {$url} in your browser.) " . "If this problem persists,";
break;
default:
$msg = "Unexpected error communicating with Stripe. " . "If this problem persists,";
}
$msg .= " let us know at [email protected].";
$msg .= "\n\n(Network error [errno {$errno}]: {$message})";
throw new Error\ApiConnection($msg);
}