# storeengine/2.2.0/includes/classes/store-engine-exception.php

StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates &amp; More, version 2.2.0. 44 lines.

- Page: https://pluginprobe.com/plugins/storeengine/2.2.0/code/includes/classes/store-engine-exception.php
- Raw: https://pluginprobe.com/plugins/storeengine/2.2.0/raw/includes/classes/store-engine-exception.php
- Modified: 2025-04-09T14:52:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/storeengine/2.2.0/code/includes/classes/store-engine-exception.php#L10-L20`.

```php
<?php

namespace StoreEngine\Classes;

if ( ! defined( 'ABSPATH' ) ) {
	die();
}

use Exception;
use WP_Error;

/**
 * WP_Error compatible exception.
 *
 * @deprecated moved to StoreEngine\Classes\Exceptions\StoreEngineException;
 */
class StoreEngineException extends Exception {

	protected $wp_code;

	protected $data = '';

	public function __construct( $message, $wp_code, $data = null, $code = 0, ?Exception $previous = null ) {
		parent::__construct( $message, $code, $previous );

		$this->wp_code = $wp_code;
		if ( $data ) {
			$this->data = $data;
		}
	}

	public function get_wp_code() {
		return $this->wp_code;
	}

	public function get_data() {
		return $this->data;
	}

	public function get_wp_error() {
		return new WP_Error( $this->wp_code, $this->getMessage(), $this->data );
	}
}

```
