private static async Task StartTask(IReadOnlyList <string> languages, IReadOnlyList <ISearchRunner> runners, IProgressReporter progressReporter, long[,] results, int li, int ri) { var arg = languages[li]; var runner = runners[ri]; try { var result = await runner.Run(arg); results[li, ri] = result; } catch (ConfigurationException ex) { throw new SearchException(arg, runner.Name, string.Format(ex.Message, arg, runner.Name), ex); } catch (WebRequestException ex) { throw new SearchException(arg, runner.Name, string.Format(ex.Message, arg, runner.Name), ex); } catch (ParsingException ex) { throw new SearchException(arg, runner.Name, string.Format(ex.Message, arg, runner.Name), ex); } if (progressReporter != null) { progressReporter.Advance(); } }
private static async Task StartTask(IReadOnlyList<string> languages, IReadOnlyList<ISearchRunner> runners, IProgressReporter progressReporter, long[,] results, int li, int ri) { var arg = languages[li]; var runner = runners[ri]; try { var result = await runner.Run(arg); results[li, ri] = result; } catch (ConfigurationException ex) { throw new SearchException(arg, runner.Name, string.Format(ex.Message, arg, runner.Name), ex); } catch (WebRequestException ex) { throw new SearchException(arg, runner.Name, string.Format(ex.Message, arg, runner.Name), ex); } catch (ParsingException ex) { throw new SearchException(arg, runner.Name, string.Format(ex.Message, arg, runner.Name), ex); } if (progressReporter != null) progressReporter.Advance(); }