def _read_file(path, mode='r'):
    """Return the contents of a file as a string.

    Returns '' if anything goes wrong, instead of throwing an IOError.

    """
    contents = ''
    try:
        with open(path, mode) as f:
            contents = f.read()
    except IOError:
        pass
    return contents