PushTokenInvalidDataException.php
35 lines
| 1 | <?php |
| 2 | /** |
| 3 | * PushTokenInvalidDataException class file. |
| 4 | */ |
| 5 | |
| 6 | declare( strict_types = 1 ); |
| 7 | |
| 8 | namespace Automattic\WooCommerce\Internal\PushNotifications\Exceptions; |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | use WC_Data_Exception; |
| 13 | use WP_Http; |
| 14 | |
| 15 | /** |
| 16 | * Exception thrown when push token data is invalid. |
| 17 | * |
| 18 | * @since 10.6.0 |
| 19 | */ |
| 20 | class PushTokenInvalidDataException extends WC_Data_Exception { |
| 21 | /** |
| 22 | * Constructor. |
| 23 | * |
| 24 | * @since 10.6.0 |
| 25 | * @param string $message The validation error message. |
| 26 | */ |
| 27 | public function __construct( string $message ) { |
| 28 | parent::__construct( |
| 29 | 'woocommerce_invalid_data', |
| 30 | $message, |
| 31 | WP_Http::BAD_REQUEST |
| 32 | ); |
| 33 | } |
| 34 | } |
| 35 |