sms icon indicating copy to clipboard operation
sms copied to clipboard

[BUG] 当请求到未知的状态时,无法正常捕捉异常

Open 233cy opened this issue 3 years ago • 1 comments

复现方式:腾讯云短信SDK模式。

  1. 不传入正确的params参数。(出现message为NULL和其他警告。)传入对象而不是数组
  2. 当套餐余额不足时(出现code类型错误。)

233cy avatar Apr 20 '22 08:04 233cy

DriverErrorException文件无法正确捕捉错误。

目前自行修改方式:

declare(strict_types=1); /**

  • 这是一个eoms系统
  • @link https://www.hyperf.io
  • @contact [email protected] */ namespace HyperfExt\Sms\Exceptions;

use Psr\Http\Message\ResponseInterface; use RuntimeException; use Throwable;

class DriverErrorException extends RuntimeException { public $response;

public function __construct(?string $message, $code = null, ResponseInterface $response = null, Throwable $previous = null)
{
    parent::__construct((string) $message, (int) $code, $previous);

    $this->response = $response;
}

final public function getResponse(): ResponseInterface
{
    return $this->response;
}

}

233cy avatar Apr 20 '22 08:04 233cy