This commit is contained in:
Lizandro Guarnizo
2026-02-21 08:51:38 -05:00
parent de4b07c806
commit 38cd62eb0e
6 changed files with 132 additions and 9 deletions
+10 -1
View File
@@ -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);