Detect more types of errors at file open