File "query-failed-response.php"

Full Path: /home/amervokv/ecomlive.net/wp-content/plugins/elementor-pro/modules/forms/submissions/data/responses/query-failed-response.php
File size: 657 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
namespace ElementorPro\Modules\Forms\Submissions\Data\Responses;

use ElementorPro\Plugin;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Query_Failed_Response  extends \WP_Error {
	public function __construct( $query_error_message, $message = null ) {
		if ( ! $message ) {
			$message = esc_html__( 'Could not retrieve query data.', 'elementor-pro' );
		}

		$this->log_error( $query_error_message );

		parent::__construct(
			'rest_internal_error',
			$message,
			[ 'status' => 500 ]
		);
	}

	private function log_error( $query_error_message ) {
		Plugin::elementor()->logger->error( $query_error_message );
	}
}