From 1869119860e5038b2a9c27137c2909835f395950 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 14 Oct 2012 09:55:23 -0400 Subject: [PATCH] Remove the error handling from JSON callbacks now that HTTP status codes are used. --- frontend/file.js | 8 ++------ frontend/main.js | 15 +++------------ frontend/path_control.js | 5 ----- frontend/tv_renamer.js | 8 ++------ 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/frontend/file.js b/frontend/file.js index 60047fa..d1e376a 100644 --- a/frontend/file.js +++ b/frontend/file.js @@ -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); }; diff --git a/frontend/main.js b/frontend/main.js index 61be7f6..ad16cc6 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -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()); }); } }; diff --git a/frontend/path_control.js b/frontend/path_control.js index 5c97737..4887b30 100644 --- a/frontend/path_control.js +++ b/frontend/path_control.js @@ -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('/'); diff --git a/frontend/tv_renamer.js b/frontend/tv_renamer.js index 9a05ed8..d828c6b 100644 --- a/frontend/tv_renamer.js +++ b/frontend/tv_renamer.js @@ -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); -- 2.22.5