Add check that function error_log exists
[MAILPOET-5026]
This commit is contained in:
@@ -83,7 +83,7 @@ class API {
|
||||
? new ErrorResponse($e->getStatusCode(), $e->getMessage(), $e->getErrorCode(), $e->getErrors())
|
||||
: new ErrorResponse(500, __('An unknown error occurred.', 'mailpoet'), 'mailpoet_automation_unknown_error');
|
||||
|
||||
if ($response->get_status() >= 500) {
|
||||
if ($response->get_status() >= 500 && function_exists('error_log')) {
|
||||
error_log((string)$e); // phpcs:ignore Squiz.PHP.DiscouragedFunctions
|
||||
}
|
||||
return $response;
|
||||
|
Reference in New Issue
Block a user