Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/elementor-pro   php

Repository URL to install this package:

Version: 3.2.1 

/ forms / submissions / data / responses / query-failed-response.php

<?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 = __( 'Something went wrong.', '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 );
	}
}