We need to grab and mark the file open before jumping to an error path