add meaningful error message on upload [fixes #773]

This commit is contained in:
Régis Hanol
2013-04-27 20:26:17 +02:00
parent eae2e74152
commit dca2fbcefc
6 changed files with 24 additions and 3 deletions
@@ -306,6 +306,10 @@ Discourse.ComposerView = Discourse.View.extend({
case 415:
bootbox.alert(Em.String.i18n('post.errors.only_images_are_supported'));
return;
// 422 == there has been an error on the server (mostly due to FastImage)
case 422:
bootbox.alert(data.jqXHR.responseText);
return;
}
}
// otherwise, display a generic error message