mardi 20 janvier 2015

How to manually reuse the error route?

How to manually reuse the error route?


So you can create a template called error, and the user will be (intermediately) transitioned to it if before/-/after model returns a promise that rejects or maybe also if they throw an error i think.


a) Is it bad practice of me to reuse this template/route for when I fail to handle some serious error that was not in the model hooks? If that is the case, why?


b) If it's not bad practice to reuse the error-template/route, how do you actually make the transition to the error route properly?


To understand, I'd like to see



  • An error route declaration in router.js (or statement that you don't use one)

  • An example of transitioning to the error route with code





Aucun commentaire:

Enregistrer un commentaire