Daniel Beck Recommended a different approach: Instead of aborting the deletion early, just truncate the list of exceptions if it gets too large. The benefits of this approach are that the actual deletion behavior is unchanged, and it avoids issues where one problematic subdirectory could result in a deletion operation not being able to remove a significant number of files because the problematic subdirectory is visited first.