<commit_before>#pragma once
#include<string>
#include "ed/data.h"
#include"type/type.h"
#include "utils/redis.h"
#include "utils/logger.h"

namespace ed{
namespace connectors{

    class ExtCode2Uri{
    public:
        Redis redis;
        log4cplus::Logger logger;

        ExtCode2Uri(const std::string& redis_connection);
        void to_redis(const ed::Data & data);

    };
}

template<typename T>
void add_redis(const std::vector<T*>& vec, connectors::ExtCode2Uri& extcode2uri){
    extcode2uri.redis.set_prefix(navitia::type::static_data::get()->captionByType(T::type));
    for(auto* element : vec){
        try{
            extcode2uri.redis.set(element->external_code, element->uri);
        }catch(const navitia::exception& ne){
            LOG4CPLUS_WARN(extcode2uri.logger, "add_redis : " + std::string(ne.what()));
        }
    }
}
}<commit_msg>ed : génération d'une exception si erreur<commit_after>#pragma once
#include<string>
#include "ed/data.h"
#include"type/type.h"
#include "utils/redis.h"
#include "utils/logger.h"

namespace ed{
namespace connectors{

    class ExtCode2Uri{
    public:
        Redis redis;
        log4cplus::Logger logger;

        ExtCode2Uri(const std::string& redis_connection);
        void to_redis(const ed::Data & data);

    };
}

template<typename T>
void add_redis(const std::vector<T*>& vec, connectors::ExtCode2Uri& extcode2uri){
    extcode2uri.redis.set_prefix(navitia::type::static_data::get()->captionByType(T::type));
    for(auto* element : vec){
        try{
            extcode2uri.redis.set(element->external_code, element->uri);
        }catch(const navitia::exception& ne){
            throw navitia::exception(ne.what());
        }
    }
}
}
{'fraction_non_alphanumeric': 0.14502923976608187, 'fraction_numerical': 0.00935672514619883, 'mean_word_length': 3.599462365591398, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7467624', 'n_tokens_mistral': 593, 'n_tokens_neox': 582, 'n_words': 102}