<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_chatlist(chatfile):
 """Try reading ids of saved chats from file. If we fail, return empty set"""

    if not chatfile:
        return set()
    try:
        with open(chatfile) as file_contents:
            return set(int(chat) for chat in file_contents)
    except (OSError, IOError) as exc:
        LOGGER.error('could not load saved chats:\n%s', exc)
        return set()