private IEnumerable<string> GetItems(Config config, ScanErrorSource source, string currentPath, Func<IEnumerable<string>> getter) { try { return getter(); } catch (Exception e) { mScanErrorHandler.Handle(config, source, currentPath, e); } return Enumerable.Empty<string>(); }
public void Handle(Config config, ScanErrorSource source, string currentPath, Exception exception) { switch (config.ScanErrorMode) { case ScanErrorMode.Ask: AskHandlers(config, source, currentPath, exception); break; case ScanErrorMode.Throw: throw new ScanException(exception.Message, exception); default: return; } }
public ScanErrorEventArgs(ScanErrorSource source, string path, Exception exception) { Source = source; Path = path; Exception = exception; }
private static void AskHandlers(Config config, ScanErrorSource source, string currentPath, Exception exception) { config.Handlers.HandleError(new ScanErrorEventArgs(source, currentPath, exception)); }