24 lines
		
	
	
		
			No EOL
		
	
	
		
			463 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			No EOL
		
	
	
		
			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;
 | 
						|
    }
 | 
						|
} |