Skip to content

Commit

Permalink
Make the error messages more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed May 14, 2015
1 parent fef8ea6 commit 0528bc1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions moduleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ public IEnumerator ApplyPatch(List<String> excludePaths, string Stage)
if (!IsBracketBalanced(mod.type))
{
log(
"Skipping a patch with unbalanced square brackets or a space (replace them with a '?') :\n" +
"Error - Skipping a patch with unbalanced square brackets or a space (replace them with a '?') :\n" +
mod.name + "\n");
errorCount++;

Expand Down Expand Up @@ -1243,7 +1243,7 @@ public IEnumerator ApplyPatch(List<String> excludePaths, string Stage)
else
{
errorCount++;
log("Error while processing " + mod.config.name +
log("Error - Error while processing " + mod.config.name +
" the copy needs to have a different name than the parent (use @name = xxx)");
}
break;
Expand Down Expand Up @@ -1313,7 +1313,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
Match match = parseValue.Match(valName);
if (!match.Success)
{
log("Cannot parse value modifying command: " + valName);
log("Error - Cannot parse value modifying command: " + valName);
errorCount++;
continue;
}
Expand All @@ -1328,7 +1328,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
// can have "node,n *" (for *= ect)
if (!int.TryParse(match.Groups[2].Value, out index))
{
Debug.LogError("Unable to parse number as number. Very odd.");
Debug.LogError("Error - Unable to parse number as number. Very odd.");
errorCount++;
continue;
}
Expand All @@ -1344,7 +1344,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
case Command.Insert:
if (match.Groups[3].Success)
{
log("Cannot use operators with insert value: " + mod.name);
log("Error - Cannot use operators with insert value: " + mod.name);
errorCount++;
}
else
Expand All @@ -1355,7 +1355,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
InsertValue(newNode, match.Groups[2].Success ? index : int.MaxValue, valName, varValue);
else
{
log("Cannot parse variable search when inserting new key " + valName + " = " +
log("Error - Cannot parse variable search when inserting new key " + valName + " = " +
modVal.value);
errorCount++;
}
Expand All @@ -1367,11 +1367,11 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
|| valName.Contains('?'))
{
if (match.Groups[2].Success)
log("Cannot use index with replace (%) value: " + mod.name);
log("Error - Cannot use index with replace (%) value: " + mod.name);
if (match.Groups[3].Success)
log("Cannot use operators with replace (%) value: " + mod.name);
log("Error - Cannot use operators with replace (%) value: " + mod.name);
if (valName.Contains('*') || valName.Contains('?'))
log("Cannot use wildcards (* or ?) with replace (%) value: " + mod.name);
log("Error - Cannot use wildcards (* or ?) with replace (%) value: " + mod.name);
errorCount++;
}
else
Expand All @@ -1384,7 +1384,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
}
else
{
log("Cannot parse variable search when replacing (%) key " + valName + " = " +
log("Error - Cannot parse variable search when replacing (%) key " + valName + " = " +
modVal.value);
errorCount++;
}
Expand Down Expand Up @@ -1418,15 +1418,15 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
}
else
{
log("Cannot parse variable search when editing key " + valName + " = " + modVal.value);
log("Error - Cannot parse variable search when editing key " + valName + " = " + modVal.value);
errorCount++;
}
break;

case Command.Delete:
if (match.Groups[3].Success)
{
log("Cannot use operators with delete (- or !) value: " + mod.name);
log("Error - Cannot use operators with delete (- or !) value: " + mod.name);
errorCount++;
}
else if (match.Groups[2].Success)
Expand Down Expand Up @@ -1459,7 +1459,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
case Command.Rename:
if (nodeStack.Count == 1)
{
log("Renaming nodes does not work on top nodes");
log("Error - Renaming nodes does not work on top nodes");
errorCount++;
break;
}
Expand All @@ -1480,7 +1480,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
if (!IsBracketBalanced(subMod.name))
{
log(
"Skipping a patch subnode with unbalanced square brackets or a space (replace them with a '?') in "
"Error - Skipping a patch subnode with unbalanced square brackets or a space (replace them with a '?') in "
+ mod.name + " : \n" + subMod.name + "\n");
errorCount++;
continue;
Expand Down Expand Up @@ -1522,7 +1522,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)

if (toPaste == null)
{
log("Can not find the node to paste in " + mod.name + " : " + subMod.name + "\n");
log("Error - Can not find the node to paste in " + mod.name + " : " + subMod.name + "\n");
errorCount++;
continue;
}
Expand Down Expand Up @@ -2055,7 +2055,7 @@ private static string ProcessVariableSearch(string value, ConfigNode node)
}
catch (Exception ex)
{
log("Failed to do a regexp replacement: " + mod.name + " : original value=\"" + oValue +
log("Error - Failed to do a regexp replacement: " + mod.name + " : original value=\"" + oValue +
"\" regexp=\"" + value +
"\" \nNote - to use regexp, the first char is used to subdivide the string (much like sed)\n" +
ex);
Expand Down Expand Up @@ -2090,7 +2090,7 @@ private static string ProcessVariableSearch(string value, ConfigNode node)
}
else
{
log("Failed to do a maths replacement: " + mod.name + " : original value=\"" + oValue +
log("Error - Failed to do a maths replacement: " + mod.name + " : original value=\"" + oValue +
"\" operator=" + op + " mod value=\"" + value + "\"");
errorCount++;
return null;
Expand Down

0 comments on commit 0528bc1

Please sign in to comment.