title: Getting stack trace from ember route error
body: <p>I went though <a href="https://speakerdeck.com/elucid/ember-errors-and-you" rel="nofollow">this presentation</a> and added the necessary <code>Ember.onerror(error);</code> to the application route's error action. However, when I attempt to log the error, I am getting what seems to be the route object (not sure what it is). Are there some additional steps I need to take? I'm using Ember CLI v.40 and Ember v1.6.1.</p>
  
  <pre><code>// routes/application.js
  import Ember from 'ember';
  
  export default Ember.Route.extend({
      actions: {
          ...
  
          error: function(error) {
              Ember.onerror(error);
              return true;
          }
      }
  });
  
  
  // initializers/bugsnag.js
  import Ember from 'ember';
  
  export default {
      name  : 'bugsnag',
      after : 'ajax-prefilter',
  
      initialize: function(container) {
          var appController, currentRoute;
  
          try {
              appController = container.lookup('controller:application');
              currentRoute  = appController.get('currentPath');
          } catch(e) {}
  
          var context = { currentRoute: currentRoute };
  
          Ember.onerror = function(error) {
              // do something with error
              console.log(error.stack) // undefined on route error
          };
      }
  };
  </code></pre>
  
  <p>I get the following in the console (produced by ember, not my code), which is the information I'm attempting to get in the initializer:</p>
  
  <pre><code>Error while processing route: calendar.create
  </code></pre>