Skip to content

Commit

Permalink
FIX: Fixed broken error message in case of communication issue during…
Browse files Browse the repository at this point in the history
… updates
  • Loading branch information
LarsMichelsen committed Dec 31, 2016
1 parent b2d9c5c commit dd8909f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -14,6 +14,7 @@ Frontend:
* FIX: Fixed wrong visualization (hover text, line color) of acknowledged services
* FIX: Overview page: Fixed disappearing maps on state changes
* FIX: Sidebar menu: Deleted maps were still visible in sidebar
* FIX: Fixed broken error message in case of communication issue during updates

1.9b10
Core:
Expand Down
12 changes: 12 additions & 0 deletions share/frontend/nagvis-js/js/ajax.js
Expand Up @@ -27,6 +27,18 @@ function call_ajax(url, args)
add_ajax_id : true,
response_handler : null,
error_handler : function(status_code, response, handler_data) {
if (response === null) {
response = {
'type' : 'error',
'title' : 'Network error',
'message' : "Failed to execute ajax call. Maybe a network issue or webserver is not available."
+ "<div class=details>\n"
+ "HTTP-Status-Code: " + status_code + "<br />\n"
+ "Time: " + iNow + "<br />\n"
+ "URL: <code>" + url.replace(/</g, '&lt;') + "</code><br />\n"
+ "</div>"
};
}
frontendMessage(response, 'serverError');
},
handler_data : null,
Expand Down
4 changes: 4 additions & 0 deletions share/frontend/nagvis-js/js/frontendMessage.js
Expand Up @@ -35,6 +35,10 @@ function frontendMessageRemove(key) {
}

function frontendMessage(oMessage, key) {
if (oMessage === null) {
throw "Could not display empty frontendMessage()";
}

var sTitle = '';
if (typeof oMessage.title !== 'undefined')
sTitle = oMessage.title;
Expand Down

0 comments on commit dd8909f

Please sign in to comment.