[yast-commit] <web-client> master : code cleanup
ref: refs/heads/master commit 53d87d86f58d584f457597d7bdd2bd772ee7e9f1 Author: Stefan Schubert <schubi@suse.de> Date: Fri Dec 18 16:04:00 2009 +0100 code cleanup --- .../app/controllers/patch_updates_controller.rb | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/plugins/patch_updates/app/controllers/patch_updates_controller.rb b/plugins/patch_updates/app/controllers/patch_updates_controller.rb index db14fb3..2c42bf9 100644 --- a/plugins/patch_updates/app/controllers/patch_updates_controller.rb +++ b/plugins/patch_updates/app/controllers/patch_updates_controller.rb @@ -16,16 +16,15 @@ class PatchUpdatesController < ApplicationController begin @patch_updates = load_proxy 'org.opensuse.yast.system.patches', :all rescue ActiveResource::ServerError => e - error_hash = Hash.from_xml e.response.body - logger.warn error_hash.inspect - if error_hash["error"] && error_hash["error"]["type"] == "PACKAGEKIT_ERROR" - flash[:error] = error_hash["error"]["description"] + ce = ClientException.new e + if ce.backend_exception_type == "PACKAGEKIT_ERROR" + flash[:error] = ce.message @patch_updates = [] @error = true else raise e end - end + end logger.debug "Available patches: #{@patch_updates.inspect}" end @@ -40,14 +39,9 @@ class PatchUpdatesController < ApplicationController patch_updates = nil error_string = _("A problem occured when loading patch information.") rescue ActiveResource::ServerError => e - error_hash = Hash.from_xml e.response.body - logger.warn error_hash.inspect - if error_hash["error"] && error_hash["error"]["type"] == "PACKAGEKIT_ERROR" - error_string = error_hash["error"]["description"] - else - error_string = _("A problem occured when loading patch information.") - end error = ClientException.new(e) + error_string = _("A problem occured when loading patch information.") + error_string = error.message if error.backend_exception_type == "PACKAGEKIT_ERROR" patch_updates = nil end patches_summary = nil -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Stefan Schubert