ref: refs/heads/master
commit 5c5ce62aa85e15947b702cf46ab28646674233e1
Author: Duncan Mac-Vicar P
Date: Wed Oct 28 13:59:33 2009 +0100
more fixes for error handling
---
.../app/controllers/application_controller.rb | 1 -
webclient/lib/client_exception.rb | 4 ++++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/webclient/app/controllers/application_controller.rb b/webclient/app/controllers/application_controller.rb
index 2c3d695..006b8d4 100644
--- a/webclient/app/controllers/application_controller.rb
+++ b/webclient/app/controllers/application_controller.rb
@@ -84,7 +84,6 @@ class ApplicationController < ActionController::Base
if request.xhr?
logger.error "Error during ajax request"
render :status => 500, :partial => "shared/exception_trap", :locals => {:error => e} and return
- #render :text => "shit" and return
end
case e
diff --git a/webclient/lib/client_exception.rb b/webclient/lib/client_exception.rb
index b2a98e4..405864c 100644
--- a/webclient/lib/client_exception.rb
+++ b/webclient/lib/client_exception.rb
@@ -24,10 +24,14 @@ class ClientException < Exception
if backend_exception?
Rails.logger.error "got exception : #{excpt.class} #{excpt.inspect}"
Rails.logger.error "code: #{excpt.response.code}" if excpt.respond_to?(:response)
+ Rails.logger.error "body: #{excpt.response.body}" if excpt.respond_to?(:response)
Rails.logger.error "methods: #{excpt.request.methods.sort}" if excpt.respond_to?(:request)
Rails.logger.error "original message: #{@excpt.message}"
xml_data = Hash.from_xml(excpt.response.body) rescue {}
@error_data.merge!(xml_data['error']) if xml_data.has_key?('error')
+
+ Rails.logger.error "Exception is a bug: #{bug?}"
+
# construct an exception from what we have
@err_msg = construct_error(@error_data) if not @error_data.empty?
Rails.logger.error "new message: #{@err_msg}"
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org