vmailadmin/app/Exceptions/ErrorException.php
2020-05-23 15:20:01 +02:00

24 lines
463 B
PHP

<?php
namespace App\Exceptions;
use Exception;
class ErrorException extends Exception
{
protected $errors =[];
public function __construct($errors)
{
if(is_array($errors))
{
$this->errors = $errors;
}
else{
$this->errors = [$errors];
}
parent::__construct(implode("\r\n-------\r\n",$this->errors));
}
public function errors()
{
return $this->errors;
}
}