<commit_before>/*
 * duktape_error.h
 *
 *  Created on: 23 Jan 2016
 *      Author: scones
 */

#ifndef INCLUDE_CORE_ERROR_DUKTAPE_ERROR_H_
#define INCLUDE_CORE_ERROR_DUKTAPE_ERROR_H_


#include "core/error/error.h"


#include <duktape/duktape.h>
#include <cstdio>
#include <iostream>
#include <duktape/duktape.h>


namespace core {

  namespace error {

    class duktape_error : public core::error::error {


      public:


      duktape_error(std::string const& what) : core::error::error(what) {
      }


      static void error_handler(duk_context* context, int code, char const* blubb) {
        char buffer[1024];
        std::snprintf(buffer, 1024, "duktape failed with error code %d: %s\nError: %s", code, blubb, duk_safe_to_string(context, -1));
        throw core::error::duktape_error(buffer);
      }

    };

  }

}


#endif /* INCLUDE_CORE_ERROR_DUKTAPE_ERROR_H_ */<commit_msg>master - better access rights<commit_after>/*
 * duktape_error.h
 *
 *  Created on: 23 Jan 2016
 *      Author: scones
 */

#ifndef INCLUDE_CORE_ERROR_DUKTAPE_ERROR_H_
#define INCLUDE_CORE_ERROR_DUKTAPE_ERROR_H_


#include "core/error/error.h"


#include <duktape/duktape.h>
#include <cstdio>
#include <iostream>
#include <duktape/duktape.h>


namespace core {

  namespace error {

    struct duktape_error : public core::error::error {

      duktape_error(std::string const& what) : core::error::error(what) {
      }


      static void error_handler(duk_context* context, int code, char const* blubb) {
        char buffer[1024];
        std::snprintf(buffer, 1024, "duktape failed with error code %d: %s\nError: %s", code, blubb, duk_safe_to_string(context, -1));
        throw core::error::duktape_error(buffer);
      }

    };

  }

}


#endif /* INCLUDE_CORE_ERROR_DUKTAPE_ERROR_H_ */
{'fraction_non_alphanumeric': 0.12304250559284116, 'fraction_numerical': 0.016778523489932886, 'mean_word_length': 3.6588541666666665, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6181922', 'n_tokens_mistral': 710, 'n_tokens_neox': 668, 'n_words': 132}