qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1618736 - in /qpid/trunk/qpid/java: bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/ broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/ broker-plugins/management-h...
Date Mon, 18 Aug 2014 21:03:36 GMT
Author: kwall
Date: Mon Aug 18 21:03:35 2014
New Revision: 1618736

URL: http://svn.apache.org/r1618736
Log:
QPID-6016: [Java Broker] Improve Web Management Console error handling

Modified:
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AccessControlProvider.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Port.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/Group.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/addGroupMember.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
Mon Aug 18 21:03:35 2014
@@ -75,7 +75,7 @@ define(["dojo/_base/xhr",
 
         if (!success)
         {
-            alert("Error:" + failureReason);
+            util.xhrErrorHandler(failureReason);
         }
         return success;
     }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
Mon Aug 18 21:03:35 2014
@@ -17,6 +17,7 @@
 package org.apache.qpid.server.management.plugin.servlet.rest;
 
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.io.Writer;
 import java.security.AccessControlException;
 import java.util.ArrayList;
@@ -564,9 +565,15 @@ public class RestServlet extends Abstrac
         else
         {
             LOGGER.warn("Caught exception", e);
-
-            // TODO
             response.setStatus(HttpServletResponse.SC_CONFLICT);
+
+            response.setContentType("application/json");
+            response.setCharacterEncoding("UTF-8");
+            PrintWriter out = response.getWriter();
+            ObjectMapper mapper = new ObjectMapper();
+            mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+            mapper.writeValue(out, Collections.singletonMap("errorMessage", e.getMessage()));
+
         }
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css
Mon Aug 18 21:03:35 2014
@@ -245,6 +245,21 @@ div .messages {
     margin: 0px 0px 10px 5px;
 }
 
+#errorDialog {
+    overflow: auto;
+    width: 400px;
+}
+
+.errorDialogErrorPrimary {
+    font-weight: bold;
+    margin-bottom: 10px;
+    max-width: 350px;
+}
+
+.errorDialogErrorSecondary {
+    font-style: italic;
+}
+
 /* Required to keep queue type radio buttons on one line when dialog adds scrollbar */
 #addQueue {
     max-height: 350px;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
Mon Aug 18 21:03:35 2014
@@ -108,17 +108,24 @@
     </div>
 
     <div class="dijitHidden">
-        <div data-dojo-type="dijit.Dialog" data-dojo-props="title: 'Connection Error'"
id="errorDialog">
-            <div style="width:400px; overflow: auto">
-                <div><strong><span id="errorMessage">An error occurred
when communicating with the broker.</span></strong></div>
-                <div><span id="statusMessage"></span></div>
-                <div style="margin-top: 10px; margin-bottom: 8px"><span id="reloadMessage">Please
try to reload.</span></div>
-                <div id="errorDetails" data-dojo-type="dijit.TitlePane" data-dojo-props="title:
'Details', open:false">
-                    <span id="errorDetailsMessage"></span>
+        <div data-dojo-type="dijit.Dialog" data-dojo-props="title: 'Error'" id="errorDialog">
+            <div>
+                <div class="errorDialogErrorPrimary">
+                    <span id="errorDialog.statusCode">000</span>&nbsp;-&nbsp;<span
id="errorDialog.errorMessage">error</span>
+                </div>
+
+                <div class="clear" class="errorDialogErrorSecondary">
+                    <div id="errorDialog.advice.reconnect">
+                        Please login again and retry your operation.
+                    </div>
+                    <div id="errorDialog.advice.retry">
+                        Please correct the problem and retry your operation.
+                    </div>
                 </div>
             </div>
             <div class="dijitDialogPaneActionBar">
-                <input type="button" value="Close" label="Close" dojoType="dijit.form.Button"
onClick="dijit.byId('errorDialog').hide();"/>
+                <input type="button" id="errorDialog.button.cancel" value="Cancel" label="Cancel"
dojoType="dijit.form.Button" onClick="dijit.byId('errorDialog').hide();"/>
+                <input type="button" id="errorDialog.button.relogin"  value="Login" label="Login"
dojoType="dijit.form.Button" onClick="dijit.byId('errorDialog').hide(); document.location.href
= '/';"/>
             </div>
         </div>
     </div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
Mon Aug 18 21:03:35 2014
@@ -25,6 +25,7 @@ define(["dojo/_base/xhr",
         "dojo/json",
         "dojo/dom-construct",
         "dojo/dom-geometry",
+        "dojo/dom-style",
         "dojo/window",
         "dojo/query",
         "dojo/parser",
@@ -47,7 +48,7 @@ define(["dojo/_base/xhr",
         "dojox/validate/web",
         "dojo/domReady!"
         ],
-       function (xhr, array, event, lang, json, dom, geometry, win, query, parser, Memory,
entities, metadata, widgetconfigurer, registry) {
+       function (xhr, array, event, lang, json, dom, geometry, domStyle, win, query, parser,
Memory, entities, metadata, widgetconfigurer, registry) {
            var util = {};
            if (Array.isArray) {
                util.isArray = function (object) {
@@ -140,7 +141,7 @@ define(["dojo/_base/xhr",
                            function(error) {success = false; failureReason = error;});
                        if(!success )
                        {
-                           alert("Error:" + failureReason);
+                           util.xhrErrorHandler(failureReason);
                        }
                    }
                }
@@ -286,7 +287,8 @@ define(["dojo/_base/xhr",
                      }
                      else
                      {
-                         alert("Error:" + this.failureReason);
+                         util.xhrErrorHandler(this.failureReason);
+
                      }
                      return false;
                  }
@@ -331,36 +333,63 @@ define(["dojo/_base/xhr",
 
            util.xhrErrorHandler = function(error)
            {
+             const fallback = "Unexpected error - see server logs";
+             var statusCodeNode = dojo.byId("errorDialog.statusCode");
+             var errorMessageNode = dojo.byId("errorDialog.errorMessage");
+             var userMustReauth = false;
+
              if (error)
              {
                if (error.hasOwnProperty("status"))
                {
+                 var hasMessage = error.hasOwnProperty("message");
+                 var message;
+
                  if (error.status == 401)
                  {
-                   dojo.byId("statusMessage").innerHTML = "401 - Authentication required.";
+                   message = hasMessage ? error.message : "Authentication required";
+                   userMustReauth = true;
                  }
                  else if (error.status == 403)
                  {
-                   dojo.byId("statusMessage").innerHTML = "403 - Access denied.";
+                   message =  hasMessage ? error.message : "Forbidden";
+                   userMustReauth = true;
                  }
                  else
                  {
-                   dojo.byId("statusMessage").innerHTML = "HTTP status code: " + error.status;
+                   message = hasMessage ? error.message : fallback;
+
+                   // Try for a more detail error sent by the Broker as json
+                   if (error.hasOwnProperty("responseText"))
+                   {
+                     try
+                     {
+                       var errorObj = json.parse(error.responseText);
+                       message = errorObj.hasOwnProperty("errorMessage") ? errorObj.errorMessage
: errorMessageNode;
+                     }
+                     catch (e)
+                     {
+                       // Ignore
+                     }
+                   }
                  }
+
+                 errorMessageNode.innerHTML = entities.encode(message ? message : fallback);
+                 statusCodeNode.innerHTML =  entities.encode(String(error.status));
+
+                 dojo.byId("errorDialog.advice.retry").style.display = userMustReauth ? "none"
: "block";
+                 dojo.byId("errorDialog.advice.reconnect").style.display = userMustReauth
? "block" : "none";
+
+                 domStyle.set(registry.byId("errorDialog.button.cancel").domNode, 'display',
userMustReauth ? "none" : "block");
+                 domStyle.set(registry.byId("errorDialog.button.relogin").domNode, 'display',
userMustReauth ? "block" : "none");
+
                }
                else
                {
-                 dojo.byId("statusMessage").innerHTML = "";
-               }
-               if (error.hasOwnProperty("message"))
-               {
-                 dojo.byId("errorDetailsMessage").innerHTML = error.message;
-                 dojo.byId("errorDetails").style.display = "block";
-               }
-               else
-               {
-                 dojo.byId("errorDetails").style.display = "none";
+                 statusCodeNode.innerHTML = "";
+                 errorMessageNode.innerHTML = fallback;
                }
+
                var dialog = dijit.byId("errorDialog");
                if (!dialog.open)
                {
@@ -412,7 +441,7 @@ define(["dojo/_base/xhr",
 
                if (syncRequired && !success)
                {
-                   alert("Error:" + failureReason);
+                   util.xhrErrorHandler(failureReason);
                }
                return success;
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AccessControlProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AccessControlProvider.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AccessControlProvider.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AccessControlProvider.js
Mon Aug 18 21:03:35 2014
@@ -87,7 +87,7 @@ define(["dojo/_base/xhr",
                      },
                      function(error) {that.success = false; that.failureReason = error;});
                  if(!this.success ) {
-                     alert("Error:" + this.failureReason);
+                     util.xhrErrorHandler(this.failureReason);
                  }
              }
          };

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js
Mon Aug 18 21:03:35 2014
@@ -112,7 +112,7 @@ define(["dojo/_base/xhr",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            };

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
Mon Aug 18 21:03:35 2014
@@ -288,7 +288,7 @@ define(["dojo/_base/xhr",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js
Mon Aug 18 21:03:35 2014
@@ -93,7 +93,7 @@ define(["dojo/_base/xhr",
                      },
                      function(error) {that.success = false; that.failureReason = error;});
                  if(!this.success ) {
-                     alert("Error:" + this.failureReason);
+                     util.xhrErrorHandler(this.failureReason);
                  }
              }
          };

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js
Mon Aug 18 21:03:35 2014
@@ -153,7 +153,7 @@ define(["dojo/dom",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Port.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Port.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Port.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Port.js
Mon Aug 18 21:03:35 2014
@@ -93,7 +93,7 @@ define(["dojo/dom",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js
Mon Aug 18 21:03:35 2014
@@ -103,7 +103,7 @@ define(["dojo/_base/xhr",
                      },
                      function(error) {that.success = false; that.failureReason = error;});
                  if(!this.success ) {
-                     alert("Error:" + this.failureReason);
+                     util.xhrErrorHandler(this.failureReason);
                  }
                }
              }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js
Mon Aug 18 21:03:35 2014
@@ -182,7 +182,7 @@ define(["dojo/_base/xhr",
         headers: { "Content-Type": "application/json"},
         putData: json.stringify(data),
         load: function(x) {success = true;},
-        error: function(error) {success = false; alert("Preferences Provider Error: " + error);}});
+        error: function(error) {success = false; util.xhrErrorHandler(error);}});
     }
     return success;
   };

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js
Mon Aug 18 21:03:35 2014
@@ -547,7 +547,7 @@ define(["dojo/_base/xhr",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js
Mon Aug 18 21:03:35 2014
@@ -154,7 +154,7 @@ define(["dojo/dom",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
Mon Aug 18 21:03:35 2014
@@ -194,7 +194,7 @@ define(["dojo/_base/xhr",
                                     }
                                     else
                                     {
-                                        alert("Authentication Provider Error:" + this.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
                                     return false;
                                 }else{

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addBinding.js
Mon Aug 18 21:03:35 2014
@@ -28,6 +28,7 @@ define(["dojo/_base/connect",
         "dojo/_base/declare",
         "dojo/store/Memory",
         "dijit/form/FilteringSelect",
+        "qpid/common/util",
         "dijit/form/NumberSpinner", // required by the form
         /* dojox/ validate resources */
         "dojox/validate/us", "dojox/validate/web",
@@ -44,7 +45,7 @@ define(["dojo/_base/connect",
         "dojox/grid/EnhancedGrid",
         "dojo/data/ObjectStore",
         "dojo/domReady!"],
-    function (connect, xhr, dom, construct, win, registry, parser, array, event, json, lang,
declare, Memory, FilteringSelect) {
+    function (connect, xhr, dom, construct, win, registry, parser, array, event, json, lang,
declare, Memory, FilteringSelect, util) {
 
         var noLocalValues = new Memory({
             data: [
@@ -325,7 +326,7 @@ define(["dojo/_base/connect",
                                     }
                                     else
                                     {
-                                        alert("Error:" + this.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
Mon Aug 18 21:03:35 2014
@@ -26,7 +26,8 @@ define(["dojo/_base/xhr",
         "dojo/parser",
         "dojo/_base/array",
         "dojo/_base/event",
-        'dojo/_base/json',
+        "dojo/_base/json",
+        "qpid/common/util",
         "dijit/form/NumberSpinner", // required by the form
         /* dojox/ validate resources */
         "dojox/validate/us", "dojox/validate/web",
@@ -41,7 +42,7 @@ define(["dojo/_base/xhr",
         /* basic dojox classes */
         "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect",
         "dojo/domReady!"],
-    function (xhr, dom, construct, win, registry, parser, array, event, json) {
+    function (xhr, dom, construct, win, registry, parser, array, event, json, util) {
 
         var addExchange = {};
 
@@ -123,7 +124,7 @@ define(["dojo/_base/xhr",
                                     }
                                     else
                                     {
-                                        alert("Error:" + this.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
Mon Aug 18 21:03:35 2014
@@ -321,7 +321,7 @@ define(["dojo/_base/xhr",
                                     }
                                     else
                                     {
-                                        alert("Error:" + this.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addQueue.js
Mon Aug 18 21:03:35 2014
@@ -178,7 +178,7 @@ define(["dojo/_base/xhr",
                                     }
                                     else
                                     {
-                                        alert("Error:" + this.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js
Mon Aug 18 21:03:35 2014
@@ -255,8 +255,7 @@ define(["dojo/_base/xhr",
           }
           else
           {
-              // What if VHN creation was successful but VH was not
-              alert("Error:" + failureReason);
+              util.xhrErrorHandler(failureReason);
           }
         }
         else

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/PrincipalDatabaseAuthenticationManager.js
Mon Aug 18 21:03:35 2014
@@ -146,7 +146,7 @@ define(["dojo/_base/xhr",
                         },
                         function(error) {that.success = false; that.failureReason = error;});
                     if(!that.success ) {
-                        alert("Error:" + this.failureReason);
+                        util.xhrErrorHandler(this.failureReason);
                     }
                 }
 }
@@ -210,7 +210,7 @@ define(["dojo/_base/xhr",
                                     if(that.success === true) {
                                         registry.byId("addUser").hide();
                                     } else {
-                                        alert("Error:" + that.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;
@@ -267,7 +267,7 @@ define(["dojo/_base/xhr",
                             if(that.success === true) {
                                 registry.byId("setPassword").hide();
                             } else {
-                                alert("Error:" + that.failureReason);
+                                util.xhrErrorHandler(this.failureReason);
                             }
 
                             return false;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js
Mon Aug 18 21:03:35 2014
@@ -130,7 +130,7 @@ define(["dojo/_base/xhr",
               }
               else
               {
-                  alert("Error:" + failureReason);
+                  util.xhrErrorHandler(failureReason);
               }
           }
           else

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js
Mon Aug 18 21:03:35 2014
@@ -121,7 +121,7 @@ define(["dojo/_base/xhr",
               }
               else
               {
-                  alert("Error:" + failureReason);
+                  util.xhrErrorHandler(failureReason);
               }
           }
           else

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/Group.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/Group.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/Group.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/Group.js
Mon Aug 18 21:03:35 2014
@@ -195,7 +195,7 @@ define(["dojo/_base/xhr",
                        },
                        function(error) {that.success = false; that.failureReason = error;});
                    if(!this.success ) {
-                       alert("Error:" + this.failureReason);
+                       util.xhrErrorHandler(this.failureReason);
                    }
                }
            }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/addGroupMember.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/addGroupMember.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/addGroupMember.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/group/addGroupMember.js
Mon Aug 18 21:03:35 2014
@@ -26,7 +26,8 @@ define(["dojo/_base/xhr",
         "dojo/parser",
         "dojo/_base/array",
         "dojo/_base/event",
-        'dojo/_base/json',
+        "dojo/_base/json",
+        "qpid/common/util",
         "dijit/form/NumberSpinner", // required by the form
         /* dojox/ validate resources */
         "dojox/validate/us", "dojox/validate/web",
@@ -41,7 +42,7 @@ define(["dojo/_base/xhr",
         /* basic dojox classes */
         "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect",
         "dojo/domReady!"],
-    function (xhr, dom, construct, win, registry, parser, array, event, json) {
+    function (xhr, dom, construct, win, registry, parser, array, event, json, util) {
 
         var addGroupMember = {};
 
@@ -83,7 +84,7 @@ define(["dojo/_base/xhr",
                                     }
                                     else
                                     {
-                                        alert("Error:" + this.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js?rev=1618736&r1=1618735&r2=1618736&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js
Mon Aug 18 21:03:35 2014
@@ -163,7 +163,7 @@ define(["dojo/_base/xhr",
                         },
                         function(error) {that.success = false; that.failureReason = error;});
                     if(!that.success ) {
-                        alert("Error:" + this.failureReason);
+                        util.xhrErrorHandler(this.failureReason);
                     }
                 }
 }
@@ -238,7 +238,7 @@ define(["dojo/_base/xhr",
                                     if(that.success === true) {
                                         registry.byId("addGroup").hide();
                                     } else {
-                                        alert("Error:" + that.failureReason);
+                                        util.xhrErrorHandler(this.failureReason);
                                     }
 
                                     return false;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message