예제 #1
0
파일: Scanner.cs 프로젝트: asipe/snarfz
 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>();
 }
예제 #2
0
 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;
       }
 }
예제 #3
0
 public ScanErrorEventArgs(ScanErrorSource source, string path, Exception exception)
 {
     Source = source;
       Path = path;
       Exception = exception;
 }
예제 #4
0
 private static void AskHandlers(Config config, ScanErrorSource source, string currentPath, Exception exception)
 {
     config.Handlers.HandleError(new ScanErrorEventArgs(source, currentPath, exception));
 }