| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\DonationForms\Exceptions; |
| 4 |
|
| 5 |
use Give\Framework\Exceptions\Contracts\LoggableException; |
| 6 |
use Give\Framework\Exceptions\Traits\Loggable; |
| 7 |
use Throwable; |
| 8 |
use WP_Error; |
| 9 |
|
| 10 |
class DonationFormFieldErrorsException extends \Exception implements LoggableException |
| 11 |
{ |
| 12 |
use Loggable; |
| 13 |
|
| 14 |
/** |
| 15 |
* @var WP_Error |
| 16 |
*/ |
| 17 |
protected $error; |
| 18 |
|
| 19 |
/** |
| 20 |
* @since 3.0.0 |
| 21 |
*/ |
| 22 |
public function __construct(WP_Error $error, Throwable $previous = null) |
| 23 |
{ |
| 24 |
parent::__construct('Form field validation error', 0, $previous); |
| 25 |
$this->error = $error; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* @since 3.0.0 |
| 30 |
*/ |
| 31 |
public function getError(): WP_Error |
| 32 |
{ |
| 33 |
return $this->error; |
| 34 |
} |
| 35 |
} |
| 36 |
|