def training_optimization_failed(error, body):
    """
    Method for make message as dict with data
    which would be send to rabbitmq if training optimization failed

    :param error: error readable message
    :param body: body of message received from RabbitMQ queue
    :type error: str
    :type body: dict
    :return: training optimization failed message
    :rtype: dict
    """

    return {
        'CorrelationId': body['CorrelationId'],
        'Id': body['Id'],
        'UserId': body['UserId'],
        'Message': error
    }