Skip to content

Commit

Permalink
Improve logging related to some exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Jun 29, 2017
1 parent 9d5797b commit e5dce48
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions moduleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,19 @@ private static void OutputAllConfigs()
Directory.CreateDirectory(path);

foreach (UrlDir.UrlConfig d in GameDatabase.Instance.root.AllConfigs)
File.WriteAllText(path + d.url.Replace('/', '.') + ".cfg", d.config.ToString());
{
string file = d.url.Replace('/', '.').Replace(':', '.');
string filePath = path + file + ".cfg";
try
{

File.WriteAllText(filePath, d.config.ToString());
}
catch (Exception e)
{
log("Exception while trying to write the file " + filePath + "\n" + e);
}
}
}

#endregion GUI stuff.
Expand Down Expand Up @@ -1130,8 +1142,14 @@ private void IsCacheUpToDate()


filesha.ComputeHash(contentBytes);
filesSha.Add(files[i].url, BitConverter.ToString(filesha.Hash));

if (!filesSha.ContainsKey(files[i].url))
{
filesSha.Add(files[i].url, BitConverter.ToString(filesha.Hash));
}
else
{
log("Duplicate fileSha key. This should not append. The key is " + files[i].url);
}
}

// Hash the mods dll path so the checksum change if dlls are moved or removed (impact NEEDS)
Expand Down

0 comments on commit e5dce48

Please sign in to comment.