PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
jetpack / jetpack_vendor / automattic / jetpack-waf / src / exceptions / class-waf-exception.php

class-waf-exception.php in Jetpack – WP Security, Backup, Speed, & Growth 16.2, at jetpack_vendor/automattic/jetpack-waf/src/exceptions/class-waf-exception.php

36 lines 539 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Base custom exception for the WAF package.
4 *
5 * @since 0.10.1
6 *
7 * @package automattic/jetpack-waf
8 */
9
10 namespace Automattic\Jetpack\Waf;
11
12 use Exception;
13 use WP_Error;
14
15 /**
16 * WAF exception.
17 */
18 class Waf_Exception extends Exception {
19
20 /**
21 * Error slug which maps to WP_Error::$code.
22 *
23 * @var string
24 */
25 const SLUG = 'waf_error';
26
27 /**
28 * Convert the exception into a WP_Error object.
29 *
30 * @return WP_Error
31 */
32 public function get_wp_error() {
33 return new WP_Error( static::SLUG, $this->getMessage() );
34 }
35 }
36