2020-02-04 01:44:16 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Exceptions;
|
|
|
|
|
2020-05-23 22:26:47 +09:00
|
|
|
use Illuminate\Support\Arr;
|
2020-02-04 01:44:16 +09:00
|
|
|
use Throwable;
|
|
|
|
|
|
|
|
class CsvImportException extends \RuntimeException
|
|
|
|
{
|
|
|
|
/** @var string[] */
|
|
|
|
private $errors;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CsvImportException constructor.
|
|
|
|
* @param string[] $errors
|
|
|
|
*/
|
2020-02-16 23:17:07 +09:00
|
|
|
public function __construct(...$errors)
|
2020-02-04 01:44:16 +09:00
|
|
|
{
|
2020-05-23 22:26:47 +09:00
|
|
|
parent::__construct(Arr::first($errors));
|
2020-02-04 01:44:16 +09:00
|
|
|
$this->errors = $errors;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string[]
|
|
|
|
*/
|
|
|
|
public function getErrors(): array
|
|
|
|
{
|
|
|
|
return $this->errors;
|
|
|
|
}
|
|
|
|
}
|