refactor : 重构代码

This commit is contained in:
何冠峰
2026-01-17 17:06:57 +08:00
parent da222c6179
commit e10888de93
13 changed files with 42 additions and 43 deletions
@@ -99,7 +99,7 @@ namespace YooAsset
if (_webRequest == null)
{
Status = EDownloadRequestStatus.Failed;
Error = $"[{GetType().Name}] Created web request is null.";
Error = $"[{GetType().Name}] Created web request is null!";
}
else
{
@@ -109,7 +109,7 @@ namespace YooAsset
catch (Exception ex)
{
Status = EDownloadRequestStatus.Failed;
Error = $"[{GetType().Name}] Failed to create web request : {ex.Message}";
Error = $"[{GetType().Name}] Failed to create web request: {ex.Message}";
}
}
}
@@ -144,7 +144,7 @@ namespace YooAsset
else
{
Status = EDownloadRequestStatus.Failed;
Error = $"[{GetType().Name}] URL: {URL} - 错误: {_webRequest.error}";
Error = $"[{GetType().Name}] URL: {URL} - Error: {_webRequest.error}";
OnRequestFailed();
}
@@ -226,7 +226,7 @@ namespace YooAsset
protected void ApplyRequestOptions(int timeout, int watchdogTime, Dictionary<string, string> headers)
{
if (_webRequest == null)
throw new YooInternalException("Web request is null !");
throw new YooInternalException("Web request is null!");
// 设置看门狗超时时间
_watchdogTime = watchdogTime;