Add descriptive error for multi-line criteria overruns.
This commit is contained in:
parent
396a5a9217
commit
d03d75aa24
1 changed files with 4 additions and 1 deletions
|
|
@ -123,6 +123,9 @@ namespace Observatory.Explorer
|
||||||
i++;
|
i++;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
if (i >= criteria.Length)
|
||||||
|
throw new Exception("Unterminated multi-line criteria.\r\nAre you missing an ::End::?");
|
||||||
|
|
||||||
script.AppendLine(criteria[i]);
|
script.AppendLine(criteria[i]);
|
||||||
i++;
|
i++;
|
||||||
} while (!criteria[i].Trim().ToLower().StartsWith("::end::"));
|
} while (!criteria[i].Trim().ToLower().StartsWith("::end::"));
|
||||||
|
|
@ -183,7 +186,7 @@ namespace Observatory.Explorer
|
||||||
StringBuilder errorDetail = new();
|
StringBuilder errorDetail = new();
|
||||||
errorDetail.AppendLine("Error Reading Custom Criteria File:")
|
errorDetail.AppendLine("Error Reading Custom Criteria File:")
|
||||||
.AppendLine(originalScript)
|
.AppendLine(originalScript)
|
||||||
.AppendLine("NOTE: Custom criteria processing has been disable to prevent further errors.");
|
.AppendLine("NOTE: Custom criteria processing has been disabled to prevent further errors.");
|
||||||
ErrorLogger(e, errorDetail.ToString());
|
ErrorLogger(e, errorDetail.ToString());
|
||||||
throw new CriteriaLoadException(e.Message, originalScript);
|
throw new CriteriaLoadException(e.Message, originalScript);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue