Solved by the-dharma-bum in post #2 
              
              
                Could you provide a bit more informations about your use case ? 
Why can’t you identify indices that correspond to corrupted file, for instance during the dataset instanciation, by looping one time over all the files, or even simplier identify those files before the dataset instanciation ? 
In your …