30 lines
503 B
PHP
30 lines
503 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Exceptions;
|
||
|
|
||
|
use Throwable;
|
||
|
|
||
|
class CsvImportException extends \RuntimeException
|
||
|
{
|
||
|
/** @var string[] */
|
||
|
private $errors;
|
||
|
|
||
|
/**
|
||
|
* CsvImportException constructor.
|
||
|
* @param string[] $errors
|
||
|
*/
|
||
|
public function __construct(array $errors)
|
||
|
{
|
||
|
parent::__construct(array_first($errors));
|
||
|
$this->errors = $errors;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string[]
|
||
|
*/
|
||
|
public function getErrors(): array
|
||
|
{
|
||
|
return $this->errors;
|
||
|
}
|
||
|
}
|