import re


def get_task_path_and_exc(file_path):
    """Get the task path and exception from the file by using its file path"""
    with open(file_path, 'r') as f:
        for line in f:
            reg = re.search('Task (.*) with id (?:[0-9a-f\-]+) raised '
                            'exception:', line)
            if reg:
                task_name = reg.group(1)
                return task_name, f.readline().strip()