mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-25 02:00:16 +00:00
perf : 异常处理替换为YOO的异常类
This commit is contained in:
@@ -87,11 +87,11 @@ namespace YooAsset
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Failed to load catalog file : {e.Message}";
|
||||
Error = $"Failed to load catalog file : {ex.Message}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ namespace YooAsset
|
||||
{
|
||||
if (_records.ContainsKey(bundle.BundleGUID))
|
||||
{
|
||||
throw new Exception("Should never get here !");
|
||||
throw new YooInternalException();
|
||||
}
|
||||
|
||||
string infoFilePath = GetBundleInfoFilePath(bundle);
|
||||
@@ -521,9 +521,9 @@ namespace YooAsset
|
||||
// 写入文件信息
|
||||
WriteBundleInfoFile(infoFilePath, bundle.FileCRC, bundle.FileSize);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
YooLogger.Error($"Failed to write cache file ! {e.Message}");
|
||||
YooLogger.Error($"Failed to write cache file ! {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace YooAsset
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
YooLogger.Error($"Failed to delete cache file ! {e.Message}");
|
||||
YooLogger.Error($"Failed to delete cache file ! {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace YooAsset
|
||||
{
|
||||
Directory.Delete(FileRootPath, true);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
YooLogger.Warning($"Failed to delete cache bundle folder : {e}");
|
||||
YooLogger.Warning($"Failed to delete cache bundle folder : {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,11 +320,11 @@ namespace YooAsset
|
||||
File.Move(recordFileElement.DataFilePath, filePath);
|
||||
_steps = ESteps.LoadCacheRawBundle;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Faild rename raw data file : {e.Message}";
|
||||
Error = $"Faild rename raw data file : {ex.Message}";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace YooAsset
|
||||
PackageName = packageName;
|
||||
|
||||
if (string.IsNullOrEmpty(packageRoot))
|
||||
throw new Exception($"{nameof(DefaultEditorFileSystem)} root directory is null or empty !");
|
||||
throw new YooFileSystemException($"{nameof(DefaultEditorFileSystem)} package root is null or empty !");
|
||||
|
||||
_packageRoot = packageRoot;
|
||||
}
|
||||
|
||||
@@ -81,11 +81,11 @@ namespace YooAsset
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Failed to load catalog file : {e.Message}";
|
||||
Error = $"Failed to load catalog file : {ex.Message}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user