<commit_before>defmodule TougouBot.Util.Error_Handler do
  @moduledoc """
  A separate module to handle different types of errors.
  I found that I was often repeating myself (especially when it came to handling http errors), 
  so this functionality has been modularised.
  """

  #Function to report an error into the console, in our live version we pipe 
  # all output into a log txt file so we just output like normal here and it'll all be logged.
  def handle_http_error(status, body, headers) do
    IO.puts("-----HTTP Error Report Start-----")

    IO.puts("HTTP Status: "<>status)<commit_msg>Fixed bug where we weren't converting the HTTP status to a string in the error handler.<commit_after>defmodule TougouBot.Util.Error_Handler do
  @moduledoc """
  A separate module to handle different types of errors.
  I found that I was often repeating myself (especially when it came to handling http errors), 
  so this functionality has been modularised.
  """

  #Function to report an error into the console, in our live version we pipe 
  # all output into a log txt file so we just output like normal here and it'll all be logged.
  def handle_http_error(status, body, headers) do
    IO.puts("-----HTTP Error Report Start-----")

    IO.puts("HTTP Status: "<>Integer.to_string(status))
{'fraction_non_alphanumeric': 0.07953667953667953, 'fraction_numerical': 0.0, 'mean_word_length': 3.764705882352941, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1276615', 'n_tokens_mistral': 361, 'n_tokens_neox': 339, 'n_words': 174}