Skip to content

Commit 6d439d8

Browse files
authored
Make process timeout handling slightly better make error regex not stupid
1 parent 8f2362b commit 6d439d8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SS14.MapServer/BuildRunners/LocalBuildService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ await process.WaitForExitAsync(cancellationToken)
116116
var log = logBuffer.ToString();
117117
// Bandaid the fact that the map renderer doesn't return an error code when rendering fails
118118

119-
if (process.ExitCode != 0 || LogErrorRegex().IsMatch(log))
119+
if (process.ExitCode != 0 || RendererFailureRegex().IsMatch(log))
120120
{
121121
var exception = new BuildException($"Error while running: {command} {string.Join(' ', arguments)}");
122122
ProcessLocalBuildException(log, "run.log", exception);
@@ -157,6 +157,6 @@ private void ProcessLocalBuildException(string log, string fileName, Exception e
157157
});
158158
}
159159

160-
[GeneratedRegex("error?|exception|fatal")]
161-
private static partial Regex LogErrorRegex();
160+
[GeneratedRegex(@"(?im)(\[(ERRO|FATL)\])|(^Unhandled exception\.)|(^\s*System\.[\w.]+Exception\b)", RegexOptions.CultureInvariant)]
161+
private static partial Regex RendererFailureRegex();
162162
}

0 commit comments

Comments
 (0)