Add error message
This commit is contained in:
parent
7f288ad381
commit
d7d969f88a
@ -185,6 +185,8 @@ $dest_lang){
|
|||||||
// sendRequest
|
// sendRequest
|
||||||
// note how referer is set manually
|
// note how referer is set manually
|
||||||
|
|
||||||
|
//print "Url to translate: ".$url."\n";
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
@ -196,6 +198,7 @@ $dest_lang){
|
|||||||
$json = json_decode($body, true);
|
$json = json_decode($body, true);
|
||||||
|
|
||||||
if ($json['responseStatus'] != 200){
|
if ($json['responseStatus'] != 200){
|
||||||
|
print "Error: ".$json['responseStatus']."\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user