title: Transition to previous route on error action ember.js
body: <p>I have the following situation to handle in ember :-</p>
  
  <ol>
  <li>I have to transition to a route which has a model hook. The model hook returns a promise. (Say route A -> route B, Route B has a model hook returning a promise)</li>
  <li>While the model hook in B is running, the loading route is entered(for showing "please wait" type msg to user).</li>
  <li>In case the model hook in B fails, I need to transition back to route A. I handle the error action in route B.</li>
  </ol>
  
  <p>The problem is, while handling error action in route B, the previous route is not always route A. It can be from other another route too.</p>
  
  <p>I tried the possible workarounds, but they didn't work out for me:-</p>
  
  <p>1) Using window.history.back() - This fails because Route B isn't entered yet, because the model hook promise failed. So I get the previous route of Route A.</p>
  
  <p>2) Using this.controllerFor('application').get('currentRouteName') - This gives the loading route (While transitioning from Route A to Route B, intermediate route 'loading' is rendered).</p>
  
  <p>I can use a conditional check with query Params, but I feel this is not efficient as I have to check for many conditions. </p>
  
  <p>I simply wish to return to the route that invoked Route B. </p>
  
  <p>Pardon me if I missed out on anything. </p>