<commit_before>angular.module('loomioApp').factory '$exceptionHandler', ($log, AppConfig) ->
  if !AppConfig.errbit.key?
    return ->

  client = new airbrakeJs.Client
    projectId:  AppConfig.errbit.key
    projectKey: AppConfig.errbit.key
    reporter:   'xhr'
    host:       AppConfig.errbit.url

  client.addFilter (notice) ->
    notice.context.environment = AppConfig.environment
    if notice.errors[0].type == ""
      null
    else
      notice

  (exception, cause) ->
    $log.error(exception)
    client.notify
      error: exception,
      params:
        current_user_id: AppConfig.currentUserId
        angular_cause: cause
<commit_msg>Add version to client exceptions<commit_after>angular.module('loomioApp').factory '$exceptionHandler', ($log, AppConfig) ->
  if !AppConfig.errbit.key?
    return ->

  client = new airbrakeJs.Client
    projectId:  AppConfig.errbit.key
    projectKey: AppConfig.errbit.key
    reporter:   'xhr'
    host:       AppConfig.errbit.url

  client.addFilter (notice) ->
    notice.context.environment = AppConfig.environment
    if notice.errors[0].type == ""
      null
    else
      notice

  (exception, cause) ->
    $log.error(exception)
    client.notify
      error: exception,
      params:
        version:         AppConfig.version
        current_user_id: AppConfig.currentUserId
        angular_cause: cause

{'fraction_non_alphanumeric': 0.10656934306569343, 'fraction_numerical': 0.00145985401459854, 'mean_word_length': 2.7664835164835164, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3622713', 'n_tokens_mistral': 418, 'n_tokens_neox': 413, 'n_words': 82}