def has_error(gsm_log):
    """
    Check if last node is high in energy or if the path is dissociative.
    """
    with open(gsm_log) as f:
        for line in reversed(f.readlines()):
            if 'high energy' in line and '-exit early-' in line:
                return True
            if 'terminating due to dissociation' in line:
                return True
    return False