Made sure errors stemming from non file objects are captured