Skip to content

Commit

Permalink
Dispaly how many exception were encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Oct 8, 2016
1 parent 517280b commit aef5577
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions moduleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private IEnumerator DataBaseReloadWithMM(bool dump = false)

log("DB Reload OK with patchCount=" + MMPatchLoader.Instance.patchedNodeCount + " errorCount=" +
MMPatchLoader.Instance.errorCount + " needsUnsatisfiedCount=" +
MMPatchLoader.Instance.needsUnsatisfiedCount);
MMPatchLoader.Instance.needsUnsatisfiedCount + " exceptionCount=" + MMPatchLoader.Instance.exceptionCount);

PartResourceLibrary.Instance.LoadDefinitions();

Expand Down Expand Up @@ -479,6 +479,8 @@ public class MMPatchLoader : LoadingSystem

public int errorCount = 0;

public int exceptionCount = 0;

public int needsUnsatisfiedCount = 0;

private int catEatenCount = 0;
Expand Down Expand Up @@ -707,6 +709,7 @@ private List<string> PrePatchInit()
{
log("Skipping :FOR init for line " + name +
". The line most likely contain a space that should be removed");
errorCount++;
}
}
}
Expand Down Expand Up @@ -1292,7 +1295,11 @@ private void StatusUpdate()
status = "ModuleManager: " + patchedNodeCount + " patch" + (patchedNodeCount != 1 ? "es" : "") + (useCache ? " loaded from cache" : " applied");

if (errorCount > 0)
status += ", found " + errorCount + " error" + (errorCount != 1 ? "s" : "");
status += ", found <color=orange>" + errorCount + " error" + (errorCount != 1 ? "s" : "") + "</color>";

if (exceptionCount > 0)
status += ", encountered <color=red>" + exceptionCount + " exception" + (exceptionCount != 1 ? "s" : "") + "</color>";

if (catEatenCount > 0)
status += ", " + catEatenCount + " patch" + (catEatenCount != 1 ? "es were" : " was") + " eaten by the Win64 cat";
}
Expand Down Expand Up @@ -1351,6 +1358,7 @@ private void CheckNeeds(List<string> excludePaths)
{
log("Exception while checking needs : " + currentMod.url + " with a type of " + currentMod.type + "\n" + ex);
log("Node is : " + PrettyConfig(currentMod));
exceptionCount++;
}
}
}
Expand Down Expand Up @@ -1640,7 +1648,8 @@ public IEnumerator ApplyPatch(List<string> excludePaths, string Stage)
catch (Exception e)
{
log("Exception while processing node : " + mod.url + "\n" + e);
log(PrettyConfig(mod));
exceptionCount++;
log("Processed node was\n" + PrettyConfig(mod));
mod.parent.configs.Remove(mod);
}
finally
Expand Down

0 comments on commit aef5577

Please sign in to comment.