 
             Object.freeze? @
 
+    setupGlobalErrorHandling: ->
+        $(document).on 'ajaxError', (event, jqxhr, settings) ->
+            unless settings.suppressErrors
+                vex.dialog.alert "<p>A <code>#{ jqxhr.statusText }</code> error occurred when trying to access:</p><pre>#{ settings.url }</pre><p>The request had status code <code>#{ jqxhr.status }</code>.</p><p>Here's the full <code>jqxhr</code> object:</p><pre>#{ utils.stringJSON jqxhr }</pre>"
+
     show: (view) ->
         if app.page.children.length
             app.page.replaceChild view.el, app.page.children[0]

        @resolveCountdown += 1
        @state = new State
        @state.fetch
            error: => vex.dialog.alert('An error occurred while trying to load the Singularity state.')
            success: -> resolve()

        resources = [{


    initialize: ->
        app.isMobile = touchDevice = 'ontouchstart' of document.documentElement
        app.setupGlobalErrorHandling()

        app.$page = $('#page')
        app.page = app.$page[0]
