up
This commit is contained in:
@@ -452,10 +452,19 @@ class WhatsAppService
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
$curlError = curl_error($ch);
|
||||
$curlErrno = curl_errno($ch);
|
||||
curl_close($ch);
|
||||
|
||||
// Log detallado para diagnóstico
|
||||
error_log("WhatsAppService::uploadMedia - URL: {$url}, HTTP: {$httpCode}, curlErrno: {$curlErrno}, curlError: {$curlError}, tokenLen: " . strlen($this->token) . ", phoneId: {$this->phoneNumberId}");
|
||||
|
||||
if ($curlErrno !== 0) {
|
||||
throw new Exception("Error de conexión subiendo archivo (curl #{$curlErrno}): {$curlError}");
|
||||
}
|
||||
|
||||
if ($httpCode !== 200 && $httpCode !== 201) {
|
||||
throw new Exception("Error subiendo archivo: " . $response);
|
||||
throw new Exception("Error subiendo archivo (HTTP {$httpCode}): " . $response);
|
||||
}
|
||||
|
||||
$result = json_decode($response, true);
|
||||
|
||||
Reference in New Issue
Block a user