AdminException.php 487 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace crmeb\exceptions;
  3. use Throwable;
  4. /**
  5. * Class AuthException
  6. * @package crmeb\exceptions
  7. */
  8. class AdminException extends \RuntimeException
  9. {
  10. public function __construct($message, $code = 0, Throwable $previous = null)
  11. {
  12. if(is_array($message)){
  13. $errInfo = $message;
  14. $message = $errInfo[1] ?? '未知错误';
  15. $code = $errInfo[0] ?? 400;
  16. }
  17. parent::__construct($message, $code, $previous);
  18. }
  19. }