<commit_before>'use strict';

angular.module('kanbanzillaApp')
  .factory('globalErrorHandling', ['$q', '$notification', function ($q, $notification) {

    function extractMessage (response) {
      var message = {title: 'Ok', body: 'Something went wrong!'};
      var el = angular.element(response);
      console.log(el);
      message.title = el[3].innerHTML;
      message.body = el[5].innerHTML;
      return message;
    }

    return function(promise) {
      return promise.then(function (successResponse) {
        return successResponse;
      }, function (errorResponse) {
        console.log(errorResponse);
        var msg = extractMessage(errorResponse.data);
        $notification.error(msg.title, msg.body);
        return $q.reject(errorResponse);
      });
    };
  }]);<commit_msg>clean up global error handling<commit_after>'use strict';

angular.module('kanbanzillaApp')
  .factory('globalErrorHandling', ['$q', '$notification', function ($q, $notification) {

    function extractMessage (response) {
      var message = {title: 'Ok', body: 'Something went wrong!'};
      var el = angular.element(response);
      console.log(el);
      message.title = el[3].innerHTML;
      message.body = el[5].innerHTML;
      return message;
    }

    function successHandler (successResponse) {
      return successResponse;
    }

    function errorHandler (errorResponse) {
      var msg = extractMessage(errorResponse.data);
      $notification.error(msg.title, msg.body);
      console.log(errorResponse);
      return $q.reject(errorResponse);
    }

    return function(promise) {
      return promise.then(successHandler, errorHandler);
    };
  }]);
{'fraction_non_alphanumeric': 0.13644524236983843, 'fraction_numerical': 0.0023937761819269898, 'mean_word_length': 3.2762148337595907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5314441', 'n_tokens_mistral': 469, 'n_tokens_neox': 460, 'n_words': 102}