<commit_before>import Ember from 'ember';
import Resolver from './resolver';
import "npm:babel-polyfill";
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

/* global L */

let App;

L.Icon.Default.imagePath = 'http://ember-prototype.s3-website-us-east-1.amazonaws.com/assets/images';

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
  rootElement: '#ember-app',
  modulePrefix: config.modulePrefix,
  podModulePrefix: config.podModulePrefix,
  Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;

Ember.onerror = function (error) {
  console.log('GLOBAL ERROR:', error.message);
  window.location = `/explore/error/${error.message}`;  
	//TODO: Quick and dirty redirect...
	//This will route to, in any case, to either a 404 or error page
	//and will nicely deposit the user back to the explore index.
	//as long as the root is /explore.
        //TODO: Need to figure out how to transition to route from here.
};<commit_msg>Narrowed Global Error scope to only handle malformed URIs.<commit_after>import Ember from 'ember';
import Resolver from './resolver';
import "npm:babel-polyfill";
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

/* global L */

let App;

L.Icon.Default.imagePath = 'http://ember-prototype.s3-website-us-east-1.amazonaws.com/assets/images';

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
  rootElement: '#ember-app',
  modulePrefix: config.modulePrefix,
  podModulePrefix: config.podModulePrefix,
  Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;

Ember.onerror = function (error) {
  console.log('GLOBAL ERROR:', error.message);
  if(error.message.toLowerCase().indexOf("uri")>-1) {
    window.location = `/explore/error/${error.message}`;
  }
	//TODO: Quick and dirty redirect...
	//This will route to, in any case, to either a 404 or error page
	//and will nicely deposit the user back to the explore index.
	//as long as the root is /explore.
  //TODO: Need to figure out how to transition to route from here.
  //TODO: One possible solution is to catch the error in the router
  //and modify the target route.
};
{'fraction_non_alphanumeric': 0.12522202486678508, 'fraction_numerical': 0.004884547069271759, 'mean_word_length': 4.179310344827586, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1002513', 'n_tokens_mistral': 707, 'n_tokens_neox': 696, 'n_words': 220}