meraproject/vendor/amocrm/amocrm-api-library/examples/error_printer.php
keboss-m 5c21d25d45 Initial commit: Merakomis portal, Docker stack and user-reader API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 11:04:05 +03:00

19 lines
339 B
PHP

<?php
use AmoCRM\Exceptions\AmoCRMApiException;
function printError(AmoCRMApiException $e): void
{
$errorTitle = $e->getTitle();
$code = $e->getCode();
$debugInfo = var_export($e->getLastRequestInfo(), true);
$error = <<<EOF
Error: $errorTitle
Code: $code
Debug: $debugInfo
EOF;
echo '<pre>' . $error . '</pre>';
}