diff --git a/Utility/NetCommonsDataServer.php b/Utility/NetCommonsDataServer.php index bcccd89a..53a6ba13 100644 --- a/Utility/NetCommonsDataServer.php +++ b/Utility/NetCommonsDataServer.php @@ -92,11 +92,8 @@ static private function __request($curl) { $error = curl_error($curl); $code = curl_getinfo($curl, CURLINFO_RESPONSE_CODE); curl_close($curl); - if ($errno !== CURLE_OK) { - throw new RuntimeException($error, $errno); - } - if ($code !== 200 && $code !== 202) { - throw new RuntimeException($code . ': ' . $result); + if ($errno !== CURLE_OK || ($code !== 200 && $code !== 202)) { + throw new BadRequestException(__d('net_commons', 'Bad Request')); } return $result; }