I'm not sure if I'm doing something wrong, but at my ApplicationRoute I have something like that:
actions: {
error: function(error, transition) {
var self = this;
metadata = {
'timeout': {
action: function(error, transition) {
BootstrapDialog.alert({message: 'Request Timeout!'});
}
},
'forbidden': {
action: function(error, transition) {
self.transitionTo('companies');
}
},
'unauthorized': {
action: function(error, transition) {
window.location.replace(error.responseJSON.redirect_url);
}
},
'bad gateway': {
action: function(error, transition) {
throw new Error("Error");
}
}
};
if(error.statusText.toLowerCase() in metadata) {
metadata[error.statusText.toLowerCase()].action(error, transition);
}
}
}
and I have a error.hbs templete, which I expect to be fired on 'bad gateway' error, but the template doesn't load, there is any specific way for me to load the default error template?
Thanks.
If you define the application error handler, you must render the error template.
App.ApplicationRoute = Ember.Route.extend({
actions: {
error: function() {
this.render('error', {
into: 'application'
});
}
}
});
An example is available here.
You could remove the error handler and check how the error template is rendered by ember.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With