catching file open errors