only return error when a file failed to open