Remove the error handling from JSON callbacks now that HTTP status codes are used.
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 14 Oct 2012 13:55:23 +0000 (09:55 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 14 Oct 2012 13:55:23 +0000 (09:55 -0400)
frontend/file.js
frontend/main.js
frontend/path_control.js
frontend/tv_renamer.js

index 60047fa22aeab0aa1ddbc0986f9a00b9818a3282..d1e376a9ede5d1dbd1ee7f1c70e8215a35269b5f 100644 (file)
@@ -137,12 +137,8 @@ armadillo.File.prototype.remove = function() {
 armadillo.File.prototype.move = function(dest) {
   var file = this;
   var callback = function(data, status, xhr) {
-    if (data['error']) {
-      app.showError(data['message']);
-    } else {
-      app.clearError();
-      app.list(app.stripLastPathComponent(dest));
-    }
+    app.clearError(true);
+    app.list(app.stripLastPathComponent(dest));
   };
   app.sendRequest('move', {'source':this.getFullPath(), 'target':dest}, callback);
 };
index 61be7f63c3abf5ed243b18a2311298f576b001cf..ad16cc60c96fe9e6670eaca20825f0e13a9ff322 100644 (file)
@@ -59,12 +59,7 @@ armadillo.App.prototype.sendRequest = function(action, data, callback) {
  */
 armadillo.App.prototype.list = function(path) {
   var callback = function(data, status, xhr) {
-    if (data['error']) {
-      app.showError(data['message']);
-      return;  // Error.
-    } else {
-      app.clearError(true);
-    }
+    app.clearError(true);
 
     // Update the listing.
     $('#pwd').text(path);
@@ -192,12 +187,8 @@ armadillo.App.prototype.mkdirHandler_ = function() {
   if (name != null && name != '') {
     var path = this.joinPath(this.getCurrentPath(), name);
     this.sendRequest('mkdir', {'path':path}, function(data, status, xhr) {
-      if (data['error']) {
-        app.showError(data['message']);
-      } else {
-        app.clearError();
-        app.list(app.getCurrentPath());
-      }
+      app.clearError(true);
+      app.list(app.getCurrentPath());
     });
   }
 };
index 5c977370fa078f1a40dfd0f12f1d80f9f45768e4..4887b30f026498a5cfb8613d6e085cbf22427b09 100644 (file)
@@ -152,11 +152,6 @@ armadillo.PathControl.prototype.createComponentNode_ = function(path, name) {
 armadillo.PathControl.prototype.fetchMenuContents_ = function(path, name, menu) {
   var fullPath = this.path_;
   var callback = function(data, status, xhr) {
-    if (data['error']) {
-      app.showError(data['message']);
-      return;
-    }
-
     // Create an empty node for the current directory.
     data.unshift('/');
 
index 9a05ed8866580eb3fb4b9ba56d2b890bf8b005ad..d828c6b249ce9aa058603b3c00d3e1f3768914df 100644 (file)
@@ -28,12 +28,8 @@ armadillo.TVRenamer = function(file) {
 armadillo.TVRenamer.prototype.run = function() {
   var file = this.file_;
   var callback = function(data, stauts, xhr) {
-    if (data['error']) {
-      app.showError(data['message']);
-    } else {
-      app.clearError();
-      file.move(data['path']);
-    }
+    app.clearError(true);
+    file.move(data['path']);
   };
   app.sendRequest('tv_rename', {'path':this.file_.getFullPath()},
       callback);