diff options
author | José Valim <jose.valim@gmail.com> | 2010-04-07 16:18:13 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-07 16:18:13 +0200 |
commit | 149d13e1f0d157a48c04c8b3944f09ce463e9416 (patch) | |
tree | b5eeda393051f268ce1033c692a5e28f3a7f6acd /actionpack/lib/action_controller/metal/responder.rb | |
parent | ec73710c79c5e1587b489b2ce05cc34138acf071 (diff) | |
download | rails-149d13e1f0d157a48c04c8b3944f09ce463e9416.tar.gz rails-149d13e1f0d157a48c04c8b3944f09ce463e9416.tar.bz2 rails-149d13e1f0d157a48c04c8b3944f09ce463e9416.zip |
Move the error raising to api_behavior.
Diffstat (limited to 'actionpack/lib/action_controller/metal/responder.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/responder.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb index d97c10a293..6ad9a23542 100644 --- a/actionpack/lib/action_controller/metal/responder.rb +++ b/actionpack/lib/action_controller/metal/responder.rb @@ -135,7 +135,6 @@ module ActionController #:nodoc: def to_format default_render rescue ActionView::MissingTemplate => e - raise unless resourceful? api_behavior(e) end @@ -154,6 +153,8 @@ module ActionController #:nodoc: # This is the common behavior for "API" requests, like :xml and :json. def api_behavior(error) + raise error unless resourceful? + if get? display resource elsif has_errors? |