void ProcessUtility_ProcessErrorFired(object?sender, EventArgs <string> e) { _logger.LogDebug($"Received error from process utility: {e.Parameter}"); var messages = e.Parameter.Split(MessageSplitters, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); foreach (var message in messages) { _logger.LogTrace($"Processing {message}..."); var match = ErrorRegex.Match(message); if (!match.Success) { continue; } var groups = match.Groups; var filePath = DecodeFromUtf8(groups[2].Value).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); var errorMessage = groups[1].Value; var eventArgs = new FilePathErrorEventArgs(errorMessage, filePath); _logger.LogTrace($"Reporting error: {eventArgs}..."); OnError(eventArgs); } }
void OnError(FilePathErrorEventArgs eventArgs) { Error?.Invoke(this, eventArgs); }