Here is the final result of my struggles with exception handling in
actionwebservice hope this saved somebody some headaches.

I fooled around with callbacks but decided the best way was to just
override the function


 def send_web_service_error_response(ws_request, e)
      # TU: This function overrides the one that is built in to the
actionwebservice class
      #     defined in action_controller_dispatcher.rb line 86
      #
      if e.kind_of? Exceptions::SoapError
        # This is a bit of a hack to put the exception name in the error message
        #  the exception method return the same exception but with a
new message.
        exception = e.exception "#{e.inspect}: #{e.message}"
      else
         #TODO:TU  Additional processing like emails etc go here
         #          The error is logged by the time this function is called.
         #          log_error(exception) unless logger.nil?
         exception = Exceptions::UnexpectedError.new("UnexpectedError
: Unexpected Error has occurred.")
      end
      exception.set_backtrace []
      super ws_request, exception
    end

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"WellRailed" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/WellRailed?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to