ValidationException.php in Billingo Official for WooCommerce trunk, at src/Exceptions/ValidationException.php
| 1 | <?php |
| 2 | |
| 3 | namespace App\Billingo\Exceptions; |
| 4 | |
| 5 | use Exception; |
| 6 | |
| 7 | class ValidationException extends BillingoException |
| 8 | { |
| 9 | |
| 10 | public function __construct( |
| 11 | private readonly array $errors, |
| 12 | int $code = 0, |
| 13 | Exception $previous = null |
| 14 | ) { |
| 15 | parent::__construct($code, $previous); |
| 16 | } |
| 17 | |
| 18 | public function getErrorMessage(): string |
| 19 | { |
| 20 | return 'Validation Failed: ' . json_encode($this->errors); |
| 21 | } |
| 22 | |
| 23 | public function getErrors(): array |
| 24 | { |
| 25 | return $this->errors; |
| 26 | } |
| 27 | } |
| 28 |