選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AdminException.php 505B

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