-
Notifications
You must be signed in to change notification settings - Fork 899
Minor changes to DirectoryHelper.DeleteDirectory() #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (!whitelist.Contains(ex.GetType())) | ||
var exceptiontype = ex.GetType(); | ||
|
||
if (!whitelist.Select(e => exceptiontype.IsAssignableFrom(e)).Any()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except it's a verbose way of saying:
!whitelist.Any(e => exceptiontype.IsAssignableFrom(e))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@ThomasBarnekow Can you fetch this and make this I didn't break anything, please? |
@nulltoken Will do. |
@nulltoken The expression must be turned around like so:
Otherwise, derived exceptions (e.g., our beloved |
Fixed. |
@nulltoken Just ran all the tests. 808 passed. 0 failed. 7 skipped. All good! I'd have two thoughts which, however, don't stand in the way of merging this fix:
|
@ThomasBarnekow Those are good points
I actually think I'd prefer them to fail the test. The noise would raise the chance for a user to open an issue about this and give us an opportunity to analyze/troubleshoot this unexpected situation.
Why not? However, by convention,
🆒 Thanks for having checked this 💖 I'm going to merge this (after a quick rebase). Let's discuss the |
- Allow derived exceptions from known ones to be whitelisted - Trace the number of failed attempts made to delete the directory - Use named parameters to make the retry parameters less "magic" to the reader
bc47582
to
e1228da
Compare
@nulltoken I agree with all of your points. |
This builds up on #971 and proposes the following modifications