aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides/actioncontroller/rescue.txt
diff options
context:
space:
mode:
authorTore Darell <toredarell@gmail.com>2008-10-08 19:07:20 +0200
committerTore Darell <toredarell@gmail.com>2008-10-08 19:07:20 +0200
commit272e70eb324fc6aa6b41f26f27ab21672588bac9 (patch)
treecbb5e1086332ff6d4d560baae8835d71a90bbc02 /railties/doc/guides/actioncontroller/rescue.txt
parent49c0b127e69cb280c3ab1fd465362e2631bd2b99 (diff)
downloadrails-272e70eb324fc6aa6b41f26f27ab21672588bac9.tar.gz
rails-272e70eb324fc6aa6b41f26f27ab21672588bac9.tar.bz2
rails-272e70eb324fc6aa6b41f26f27ab21672588bac9.zip
Remove part about Ruby's rescue
Diffstat (limited to 'railties/doc/guides/actioncontroller/rescue.txt')
-rw-r--r--railties/doc/guides/actioncontroller/rescue.txt27
1 files changed, 0 insertions, 27 deletions
diff --git a/railties/doc/guides/actioncontroller/rescue.txt b/railties/doc/guides/actioncontroller/rescue.txt
index 989c8ee3d8..cd8612afe5 100644
--- a/railties/doc/guides/actioncontroller/rescue.txt
+++ b/railties/doc/guides/actioncontroller/rescue.txt
@@ -65,30 +65,3 @@ end
-----------------------------------
NOTE: Certain exceptions are only rescuable from the ApplicationController class, as they are raised before the controller gets initialized and the action gets executed. See Partik Naik's link:http://m.onkey.org/2008/7/20/rescue-from-dispatching[article] on the subject for more information.
-
-=== Getting down and dirty ===
-
-Of course you can still use Ruby's `rescue` to rescue exceptions wherever you want. This is usually constrained to single methods, i.e. actions, but is still a very useful technique that should be used when appropriate. For example, you might use an API that raises a timeout error in one of your actions, and you have to handle that if it's raised:
-
-[source, ruby]
-----------------------------------------
-require 'clients_international'
-class ClientsController < ApplicationController
-
- def update
- @client = Client.find(params[:id])
- @client.attributes = params[:client]
- if @client.save
- flash[:notice] = "Client was updated"
- ClientsInternational.send_update(@client.to_xml)
- redirect_to clients_url
- else
- render :action => "new"
- end
- rescue ClientsInternational::TimeoutError
- flash[:error] = "Couldn't send API update"
- redirect_to @client
- end
-
-end
-----------------------------------------