Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
233cy opened this issue Apr 20, 2022 · 1 comment
Open

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

233cy opened this issue Apr 20, 2022 · 1 comment

Comments

@233cy
Copy link

233cy commented Apr 20, 2022

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

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

233cy commented Apr 20, 2022

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

目前自行修改方式:

declare(strict_types=1);
/**

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;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant