Skip to content

Commit 0bfc695

Browse files
committed
displaying error messages
1 parent 2d3cad9 commit 0bfc695

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/main/webapp/res/js/models.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,10 +2046,19 @@ var StatsView = Backbone.View.extend({
20462046
},
20472047
error: function(model, response, options) {
20482048
self.$el.fadeOut();
2049-
if( response.responseJSON !== undefined && response.responseJSON.status == "error" )
2050-
console.log("Error while fetching stats: " + response.responseJSON.errors);
2049+
var msg = "";
2050+
if( response.responseJSON !== undefined && response.responseJSON.status == "error" ) {
2051+
msg = "<b>Error while fetching stats:</b> <ul>";
2052+
_.each(response.responseJSON.errors, function (text) {
2053+
msg += "<li>" + text + "</li>";
2054+
});
2055+
msg += "</ul>";
2056+
}
20512057
else
2052-
console.log("Error while fetching stats!");
2058+
msg = "Error while fetching stats!";
2059+
2060+
console.log(msg);
2061+
self.$el.html(msg).fadeIn();
20532062
}
20542063
});
20552064

0 commit comments

Comments
 (0)