<?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;
    }
}