1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php
namespace iThemesSecurity\Exception;
class WP_Error extends \Exception implements Exception {
/** @var \WP_Error */ private $error;
public function __construct( \WP_Error $error, \Exception $previous = null ) { $this->error = $error; parent::__construct( wp_sprintf( '%l', $error->get_error_messages() ), 0, $previous ); }
/** * Create a WP Error instance from an error code and message. * * @param string $code * @param string $message * @param array $data * * @return static */ public static function from_code( $code, $message, array $data = [] ) { return new static( new \WP_Error( $code, $message, $data ) ); }
/** * Get the WP Error instance. * * @return \WP_Error */ public function get_error() { return $this->error; } }
|