aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib/action_web_service/dispatcher
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-03-29 09:04:31 +0000
committerLeon Breedt <bitserf@gmail.com>2005-03-29 09:04:31 +0000
commit37270359ac5a4e09eb3caff58963327bfb699460 (patch)
tree9e0e6ae2f5c2fc4c0734401c6c5ebcacd92822de /actionwebservice/lib/action_web_service/dispatcher
parentc73a414a9abdb9943f18f6a60ed9f805e97e2ea1 (diff)
downloadrails-37270359ac5a4e09eb3caff58963327bfb699460.tar.gz
rails-37270359ac5a4e09eb3caff58963327bfb699460.tar.bz2
rails-37270359ac5a4e09eb3caff58963327bfb699460.zip
remove wrongheaded uses of "rescue nil" if it will mask a useful exception. also include
the whole backtrace in the 500 error response body if exception reporting is turned on (the default). git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/dispatcher')
-rw-r--r--actionwebservice/lib/action_web_service/dispatcher/abstract.rb5
-rw-r--r--actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb4
2 files changed, 4 insertions, 5 deletions
diff --git a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
index 4c184fb140..69c3b9de3b 100644
--- a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
+++ b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb
@@ -76,10 +76,7 @@ module ActionWebService # :nodoc:
invocation.api = self.class.web_service_api
invocation.service = self
when :delegated, :layered
- invocation.service = web_service_object(invocation.service_name) rescue nil
- unless invocation.service
- raise(DispatcherError, "service #{invocation.service_name} not available")
- end
+ invocation.service = web_service_object(invocation.service_name)
invocation.api = invocation.service.class.web_service_api
end
request.api = invocation.api
diff --git a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
index 8a2b1d1c7d..3c9a6e2c78 100644
--- a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
+++ b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
@@ -89,10 +89,12 @@ module ActionWebService # :nodoc:
else
if self.class.web_service_exception_reporting
message = exception.message
+ backtrace = "\nBacktrace:\n#{exception.backtrace.join("\n")}"
else
message = "Exception raised"
+ backtrace = ""
end
- render_text("Internal protocol error: #{message}", "500 #{message}")
+ render_text("Internal protocol error: #{message}#{backtrace}", "500 #{message}")
end
end