ref: refs/heads/master
commit a578da3176c3c3b8bd602335b25f4f8b67d7d19e
Author: Jiri Suchomel
Date: Mon Oct 5 12:32:26 2009 +0200
handle ADMINISTRATOR_ERROR only
---
.../app/controllers/administrator_controller.rb | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/plugins/administrator/app/controllers/administrator_controller.rb b/plugins/administrator/app/controllers/administrator_controller.rb
index 39b7720..1eb248a 100644
--- a/plugins/administrator/app/controllers/administrator_controller.rb
+++ b/plugins/administrator/app/controllers/administrator_controller.rb
@@ -62,11 +62,15 @@ class AdministratorController < ApplicationController
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
logger.warn e.inspect
- # handle backend exception here, not by generic handler:
+ # handle ADMINISTRATOR_ERROR in backend exception here, not by generic handler
rescue ActiveResource::ServerError => e
error = Hash.from_xml e.response.body
logger.warn error.inspect
- flash[:error] = _("Error while savig administrator settings: #{error["error"]["output"]}")
+ if error["error"] && error["error"]["type"] == "ADMINISTRATOR_ERROR"
+ flash[:error] = _("Error while saving administrator settings: #{error["error"]["output"]}")
+ else
+ raise e
+ end
end
if params.has_key? "commit"
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org