AuthException.php 984 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | [ 认证异常抛出 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018-2020 rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: TABLE ME
  8. // +----------------------------------------------------------------------
  9. // | Date: 2020-08-25 16:18
  10. // +----------------------------------------------------------------------
  11. namespace library\exceptions;
  12. use Throwable;
  13. /**
  14. * Class AuthException
  15. * @package \exceptions
  16. */
  17. class AuthException extends \RuntimeException
  18. {
  19. public function __construct($message = "", $code = -1, Throwable $previous = null)
  20. {
  21. if (is_array($message)) {
  22. $errInfo = $message;
  23. $message = $errInfo[1] ?? '未知错误';
  24. $code = $errInfo[0] ?? -1;
  25. }
  26. parent::__construct($message, $code, $previous);
  27. }
  28. }