Added validation and error handling

BETA READY
This commit is contained in:
Robert McRackan 2019-11-15 22:43:04 -05:00
parent e319326c30
commit b9314ac678
7 changed files with 42 additions and 34 deletions

View file

@ -40,5 +40,10 @@ namespace FileLiberator
return null;
}
}
public static async Task<StatusHandler> TryProcessAsync(this IProcessable processable, LibraryBook libraryBook)
=> await processable.ValidateAsync(libraryBook)
? await processable.ProcessAsync(libraryBook)
: new StatusHandler();
}
}