diff --git a/web/src/main/webapp/common/services/alerts.service.js b/web/src/main/webapp/common/services/alerts.service.js index 2d6fa27b8..d70e36417 100644 --- a/web/src/main/webapp/common/services/alerts.service.js +++ b/web/src/main/webapp/common/services/alerts.service.js @@ -15,10 +15,19 @@ return this.$parent; }.bind(this); - this.showError = function (msg) { + this.showError = function (vResult) { $timeout(function () { - this.getElement('.error').show(); - this.getElement('.error .msg').text(msg); + this.getElement('.error').show(); + if ( typeof msg == "string" ) { + this.getElement('.error .msg').text(vResult); + } else { + this.getElement('.error .msg').text(vResult.message); + this.getElement('.error .method').text(vResult.request.method); + this.getElement('.error .header').html(this._transTableFormat(vResult.request.heads)); + this.getElement('.error .parameters').html(this._transTableFormat(vResult.request.parameters)); + this.getElement('.error .url').text(vResult.request.url); + this.getElement('.error .stacktrace').text(vResult.stacktrace); + } }.bind(this), 300); }.bind(this); this.hideError = function () { @@ -54,6 +63,16 @@ this.getElement = function (selector) { return this.$parent ? $(selector, this.$parent) : $(selector); }.bind(this); + this._transTableFormat = function( obj ) { + var str = [ ""]; + for( var p in obj ) { + str.push(""); + str.push(""); + str.push(""); + } + str.push("
" + p + "" + obj[p] + "
"); + return str.join(""); + } }; }]); })(); \ No newline at end of file diff --git a/web/src/main/webapp/features/serverMap/server-map.directive.js b/web/src/main/webapp/features/serverMap/server-map.directive.js index 1c61b1d0e..6fb8f7ed3 100644 --- a/web/src/main/webapp/features/serverMap/server-map.directive.js +++ b/web/src/main/webapp/features/serverMap/server-map.directive.js @@ -191,9 +191,13 @@ }); } else { ServerMapDaoService.getServerMapData(htLastQuery, function (err, query, mapData) { - if (err) { + if (err || mapData.exception ) { oProgressBarService.stopLoading(); - oAlertService.showError('There is some error.'); + if ( err ) { + oAlertService.showError('There is some error.'); + } else { + oAlertService.showError(mapData.exception); + } scope.$emit('serverMapDirective.hasNoData'); return false; } diff --git a/web/src/main/webapp/index.html b/web/src/main/webapp/index.html index b64527b12..960f64e43 100644 --- a/web/src/main/webapp/index.html +++ b/web/src/main/webapp/index.html @@ -133,12 +133,37 @@