1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +02:00

Better handling of AJAX errors

This commit is contained in:
Toby Zerner
2015-02-03 18:40:34 +10:30
parent 8c15420f95
commit 46c538c157
2 changed files with 25 additions and 7 deletions

View File

@@ -88,11 +88,14 @@ export default Ember.ObjectController.extend(Ember.Evented, {
}
},
function(reason) {
var message = AlertMessage.create({
type: 'warning',
message: reason.errors[0].detail
});
controller.get('controllers.application').send('alert', message);
var errors = reason.errors;
for (var i in reason.errors) {
var message = AlertMessage.create({
type: 'warning',
message: reason.errors[i]
});
controller.get('controllers.application').send('alert', message);
}
})
.finally(function() {
composer.set('content.loading', false);