UtilException.php 969 B

12345678910111213141516171819202122232425262728
  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 Carbon\Exceptions\RuntimeException;
  13. use Throwable;
  14. class UtilException extends \RuntimeException
  15. {
  16. public function __construct($message = "", $code = -1, Throwable $previous = null)
  17. {
  18. if (is_array($message)) {
  19. $errInfo = $message;
  20. $message = $errInfo[1] ?? '未知错误';
  21. $code = $errInfo[0] ?? -1;
  22. }
  23. parent::__construct($message, $code, $previous);
  24. }
  25. }