| 1 |
<?php |
| 2 |
|
| 3 |
namespace Nabik\Gateland\Exceptions; |
| 4 |
|
| 5 |
use Rakit\Validation\ErrorBag; |
| 6 |
use Throwable; |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
final class ValidationErrorException extends \Exception { |
| 11 |
|
| 12 |
private $errors; |
| 13 |
|
| 14 |
public function __construct( $errors, $message = "", $code = 0, Throwable $previous = null ) { |
| 15 |
|
| 16 |
$this->errors = $errors; |
| 17 |
|
| 18 |
parent::__construct( $message, $code, $previous ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* @return ErrorBag |
| 23 |
*/ |
| 24 |
public function getErrors() { |
| 25 |
return $this->errors; |
| 26 |
} |
| 27 |
} |