CommonBusinessException.php 443 B

123456789101112131415161718
  1. <?php
  2. namespace Modules\Common\Exceptions;
  3. use Catch\Exceptions\CatchException;
  4. use Throwable;
  5. class CommonBusinessException extends CatchException
  6. {
  7. public function __construct($message = "", $code = 0, Throwable $previous = null)
  8. {
  9. parent::__construct($message, $code);
  10. }
  11. public static function throwError($error, Throwable $previous = null) {
  12. throw (new static($error[1], $error[0], $previous));
  13. }
  14. }