Handling a broken backend?


#1

Today I experienced a “white screen of death” when I forgot to put the URL of our Firebase instance in config/environment.js.

I’m not sure if the Firebase adapter (emberfire) could have handled this more gracefully, but I wanted to ask about good ways to handle an unresponsive/broken backend. At the very least, how to make sure that the templates render with no data.

I’m still new to Ember and don’t fully understand all of its intricacies yet so I’d be interested to hear others’ solutions.

Thanks


#2

You can leverage the error substate. If you return a promise from your Route’s model hooks and that promise is rejected, the route will attempt to transition to a series of error substates.

You can read more about this here http://emberjs.com/guides/routing/loading-and-error-substates/#toc_code-error-code-substates


#3

Oh, duh. I forgot about the error substates. I didn’t realize a rejected promise from the model would trigger that. Thanks for the link.