private static void PrintExcepitonLog(Exception e) { if (e.GetType() == typeof(InvalidOperationException)) { LogTools.PrintError("打包失败,文件已损坏"); } else { LogTools.PrintError(e.GetType().Name + e.Message); } LogTools.Error(GetDetailsInfo(), e); //将失败的文件拷贝至指定目录 try { String exceptionFilePath = GlobalConstants.AbsoluteResourcesPath + "/" + FileTools.GetFileName(srcPath); if (FileTools.FileExists(exceptionFilePath)) { LogTools.Info("发生异常的文件存在,文件路径为:" + exceptionFilePath); if (!FileTools.DirectoryExists(GlobalConstants.ExceptionFBXFolder)) { FileTools.CreateDirectory(GlobalConstants.ExceptionFBXFolder); } String destFilePath = GlobalConstants.ExceptionFBXFolder + "/" + FileTools.GetFileName(exceptionFilePath) + "(" + DateTime.Now.ToString("yyyy-MM-dd HH.mm.ss") + ")"; FileTools.CopyFile(exceptionFilePath, destFilePath); } else { LogTools.Info("发生异常的文件不存在,文件路径为"); } } catch (Exception ee) { LogTools.Error(GetDetailsInfo(), ee); } }