代码拉取完成,页面将自动刷新
💢 特别说明:如果 Issue 没有严格按照模板编写且未提供测试源码下载或 Git 测试仓库地址,则视为无效
Issue
。
哪个版本号?
SendAsync出异常后,如果OnRequestFailded没有赋值,会出现空引用
try
{
if (RetryPolicy == null) response = await httpClient.SendAsync(request, cancellationToken);
else
{
// 失败重试
await Retry.Invoke(async () =>
{
// 发送请求
response = await httpClient.SendAsync(request, cancellationToken);
}, RetryPolicy.Value.NumRetries, RetryPolicy.Value.RetryTimeout);
}
}
catch (Exception ex)
{
// 触发自定义事件
if (response != null) OnRequestFailded(this, new HttpRequestFaildedEventArgs(request, response, ex));
exception = ex;
}
System.NullReferenceException:“Object reference not set to an instance of an object.”
⚠⚠ 必须提供完整可运行且包含错误的
Git
仓库 DEMO,DEMO 提供最简单的错误逻辑代码,否则不予处理。⚠⚠
您的代码下载地址?
先判断OnRequestFailded是否为空,再调用失败事件