diff --git a/htdocs/frontend/javascripts/functions.js b/htdocs/frontend/javascripts/functions.js
index 370bd178d..6fc5353c1 100644
--- a/htdocs/frontend/javascripts/functions.js
+++ b/htdocs/frontend/javascripts/functions.js
@@ -96,10 +96,10 @@ vz.getPermalink = function() {
vz.load = function(args) {
$.extend(args, {
accepts: 'application/json',
- beforeSend: function (xhr, settings) {
- // remember URL for potential error messages
- xhr.requestUrl = settings.url;
- },
+ beforeSend: function (xhr, settings) {
+ // remember URL for potential error messages
+ xhr.requestUrl = settings.url;
+ },
error: function(xhr) {
try {
var msg;
@@ -112,11 +112,20 @@ vz.load = function(args) {
}
}
else {
- msg = xhr.requestUrl + ':
Unknown middleware response';
+ msg = "" + xhr.requestUrl + "";
if (xhr.responseText) {
msg += '
' + $(xhr.responseText).text().substring(0,300);
}
- throw new Exception(xhr.statusText, msg, xhr.status);
+
+ var title = "Network Error";
+ if (xhr.status > 0) {
+ title += " (" + xhr.status + " " + xhr.statusText + ")";
+ }
+ else if (xhr.statusText !== "") {
+ title += " (" + xhr.statusText + ")";
+ }
+
+ throw new Exception(title, msg);
}
}
catch (e) {
diff --git a/htdocs/frontend/javascripts/wui.js b/htdocs/frontend/javascripts/wui.js
index 92264eec8..948ed848f 100644
--- a/htdocs/frontend/javascripts/wui.js
+++ b/htdocs/frontend/javascripts/wui.js
@@ -834,9 +834,12 @@ vz.wui.dialogs.error = function(error, description, code) {
error = code + ': ' + error;
}
- $('