HEX
Server: nginx/1.27.0
System: Linux 20d173156d2c 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-exception.php
<?php
/**
 * WooCommerce Stripe Exception Class
 *
 * Extends Exception to provide additional data
 *
 * @since 4.0.2
 */

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

class WC_Stripe_Exception extends Exception {

	/**
	 * String sanitized/localized error message.
	 *
	 * @var string */
	protected $localized_message;

	/**
	 * Setup exception
	 *
	 * @since 4.0.2
	 * @param string $error_message Full response
	 * @param string $localized_message user-friendly translated error message
	 */
	public function __construct( $error_message = '', $localized_message = '' ) {
		$this->localized_message = $localized_message;
		parent::__construct( $error_message );
	}

	/**
	 * Returns the localized message.
	 *
	 * @since 4.0.2
	 * @return string
	 */
	public function getLocalizedMessage() {
		return $this->localized_message;
	}
}