12345678910111213141516171819202122 |
- <?php
- namespace App\Exceptions;
- class CommonException extends \Exception
- {
- /**
- * CommonException constructor.
- */
- public function __construct($arr,$replace="")
- {
- if(is_string($arr)){
- parent::__construct($arr);
- }elseif(is_array($arr)){
- $errorMsg = $replace?$replace:$arr[1];
- parent::__construct($errorMsg,$arr[0]);
- }
- }
- }
|