]> source.dussan.org Git - archiva.git/commitdiff
we now have a generic way to handle errors
authorOlivier Lamy <olamy@apache.org>
Tue, 11 Sep 2012 07:37:05 +0000 (07:37 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 11 Sep 2012 07:37:05 +0000 (07:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1383269 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js

index 347436fe58ef5dc4549da7a0b6c2da04a0bfeead..b4f48d2943ad7defddb3fba3e484668e831d7bd1 100644 (file)
@@ -176,8 +176,6 @@ define("redback",["jquery","utils","jquery.validate","jquery.json","knockout",
               removeSmallSpinnerImg();
             },
             error: function(result) {
-              var obj = jQuery.parseJSON(result.responseText);
-              displayRedbackError(obj);
               window.modalRegisterWindow.modal('hide');
             }
           });
@@ -205,9 +203,6 @@ define("redback",["jquery","utils","jquery.validate","jquery.json","knockout",
        },
        error: function(result) {
          $.log("validateKey#error");
-         var obj = jQuery.parseJSON(result.responseText);
-         $.log("validateKey#error response:"+obj);
-         displayRedbackError(obj);
        }
     })
   }
index dca92888c01aa42377cc2f677579a8d6cc640861..dcaa3956f1f9f93c03b1e25f313105f0240432be 100644 (file)
@@ -113,10 +113,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
             } else {
               displayErrorMessage("user cannot created");
             }
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
         });
     };
@@ -149,10 +145,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
             } else {
               displayErrorMessage("admin user not created");
             }
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
         });
     };
@@ -177,10 +169,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
             } else {
               displayErrorMessage("user cannot be updated");
             }
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
         });
     }
@@ -213,10 +201,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
           dataType: 'json',
           success: function(result) {
             displaySuccessMessage($.i18n.prop("user.roles.updated",curUser.username()));
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
         });
     }
@@ -230,10 +214,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
           success: function(result) {
             displaySuccessMessage($.i18n.prop("user.locked",curUser.username()));
             curUser.modified(false);
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
         });
     }
@@ -247,10 +227,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
           success: function(result) {
             displaySuccessMessage($.i18n.prop("user.unlocked",curUser.username()));
             curUser.modified(false);
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
       });
     }
@@ -268,10 +244,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
           success: function(result) {
             displaySuccessMessage($.i18n.prop("user.passwordChangeRequired.updated",curUser.username(),value));
             curUser.modified(false);
-          },
-          error: function(result) {
-            var obj = jQuery.parseJSON(result.responseText);
-            displayRedbackError(obj);
           }
       });
     };
@@ -474,10 +446,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
               displayErrorMessage("issue appended");
             }
             window.modalChangePasswordBox.modal('hide');
-          },
-          error: function(result) {
-           var obj = jQuery.parseJSON(result.responseText);
-           displayRedbackError(obj,"modal-password-change-content");
           }
         });
 
@@ -520,11 +488,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
             success: function(result) {
               clearUserMessages();
               displayInfoMessage($.i18n.prop("password.reset.success"));
-            },
-            error: function(result) {
-              clearUserMessages();
-              var obj = jQuery.parseJSON(result.responseText);
-              displayRedbackError(obj);
             }
           });
         }
@@ -748,11 +711,6 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno
           displayErrorMessage("issue appended");
         }
         window.modalChangePasswordBox.modal('hide');
-      },
-      error: function(result) {
-       var obj = jQuery.parseJSON(result.responseText);
-       displayRedbackError(obj);
-       logout(false);
       }
     });
 
index e4778b38613fa4ae748322277493a04f1ba6d07b..1c20016802b9f81cb7096fbf90956f36193ad8ae 100644 (file)
@@ -108,10 +108,6 @@ define("redback.users",["jquery","utils","i18n","jquery.validate","knockout","kn
                 displaySuccessMessage( $.i18n.prop("user.deleted", currentUser.username()));
                 self.users.remove(currentUser);
               },
-              error: function(result) {
-               var obj = jQuery.parseJSON(result.responseText);
-               displayRedbackError(obj);
-              },
               complete: function() {
                 closeDialogConfirm();
               }