/*global require*/
/*jslint white:true*/
require(['require-config'], function() {
    'use strict';
    require(['app/main'], function (main) {
        main.start()
            .catch(function (err) {
                document.getElementById('root').innerHTML = 'Error starting KBase UI. Please consult the browser error log.';
                console.error('app is unhappy :(');
                console.error(err);
            });
    });
});
@@ -9,16 +9,31 @@
  require
+, KBaseFallback
 */%0A/*jsl
@@ -53,110 +53,3147 @@
 e*/%0A
-require(%5B'require-config'%5D, function() %7B%0A    'use strict';%0A    require(%5B'app/main'%5D, function (main) %7B
+(function (root) %7B%0A    function handleGlobalError(err) %7B%0A        'use strict';%0A%0A        switch (err.requireType) %7B%0A            case 'notloaded':%0A                if (/xesprima/.test(err.message)) %7B%0A                    // ignore esprima for now. The loading is attempted within the %0A                    // yaml library ...%0A                    console.warn('esprima require test detected');%0A                    return;%0A                %7D%0A                break;%0A        %7D%0A%0A        console.error('AMD Error');%0A        console.error('Type', err.requireType);%0A        console.error('Modules', err.requireModules);%0A        console.error('Message', err.message);%0A        console.error(err);%0A%0A        throw err;%0A    %7D%0A    %0A    function handleStartupError(err) %7B%0A        'use strict';%0A%0A        switch (err.requireType) %7B%0A            case 'notloaded':%0A                if (/xesprima/.test(err.message)) %7B%0A                    // ignore esprima for now. The loading is attempted within the %0A                    // yaml library ...%0A                    console.warn('esprima require test detected');%0A                    return;%0A                %7D%0A                break;%0A            case 'scripterror':%0A                if (err.requireModules) %7B%0A                    if (err.requireModules.some(function (moduleName) %7B%0A                        return (moduleName === 'app/googleAnalytics');%0A                    %7D)) %7B%0A                        // KBaseFallback.redirect('/pages/gablocked.html');%0A                        KBaseFallback.showError(%7B%0A                            title: 'Analytics Blocked',%0A                            content: %5B%0A                                'A browser setting, plugin, or other constraint has prevented the Analytics module from loading. KBase uses this module to measure usage of the Narrative Interface (NI). The Narrative Interface will not operate with this constraint in place.'%0A                            %5D,%0A                            references: %5B%0A                                %7B%0A                                    title: 'Incompatible Plugins',%0A                                    url: 'http://kbase.us/incompatible-plugins'%0A                                %7D%0A                            %5D%0A                        %7D);%0A                        return;%0A                    %7D%0A                %7D%0A                break;%0A        %7D%0A%0A        KBaseFallback.showError(%7B%0A            title: 'AMD Error',%0A            content: %5B%0A                'An error has occurred while loading one of the modules required to run the KBase Application.',%0A                err.message,%0A                'Type: ' + err.requireType,%0A                err.requireModules ? 'Modules: ' + err.requireModules.join(', ') : null%0A            %5D,%0A            references: %5B%0A                %7B%0A                    title: 'Reporting Application Errors',%0A                    url: 'http://kbase.us/contact-us'%0A                %7D%0A            %5D%0A        %7D);%0A%0A        throw err;%0A    %7D%0A    %0A    require.onError = handleGlobalError;%0A%0A    require(%5B'app/main'%5D, function (main) %7B%0A        'use strict';%0A        if (root.KBaseFallback.getErrorState()) %7B%0A            return;%0A        %7D
 %0A   
@@ -3407,78 +3407,100 @@
 or('
-app is unhappy :(');%0A                console.error(err);%0A            %7D
+Startup Error', err);%0A            %7D);%0A    %7D, function (err) %7B%0A        handleStartupError(err
 );%0A 
@@ -3507,10 +3507,18 @@
    %7D);%0A%7D
+(window)
 );

enhance error handling to catch uBlock origin technique for blocking google analytics; startup as well as default error handling. Startup invokes the fallback error rendering methods, runtime just logs to the console for now.