aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/abstract/exceptions.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-08 17:41:08 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-08 17:41:08 -0700
commitbe371993b7c0bb5110a38d4c3bade116b66a904a (patch)
tree643a58a5024714a507c9fef32b818dedf8944696 /actionpack/lib/action_controller/abstract/exceptions.rb
parent38b608ecab2441cd0c4e75bc08bdf57fcf85dd71 (diff)
downloadrails-be371993b7c0bb5110a38d4c3bade116b66a904a.tar.gz
rails-be371993b7c0bb5110a38d4c3bade116b66a904a.tar.bz2
rails-be371993b7c0bb5110a38d4c3bade116b66a904a.zip
More documentation work on AbstractController
This is still not completely done and there might be pointers to things that don't exist yet.
Diffstat (limited to 'actionpack/lib/action_controller/abstract/exceptions.rb')
-rw-r--r--actionpack/lib/action_controller/abstract/exceptions.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/abstract/exceptions.rb b/actionpack/lib/action_controller/abstract/exceptions.rb
index 2f6c55f068..b671516de1 100644
--- a/actionpack/lib/action_controller/abstract/exceptions.rb
+++ b/actionpack/lib/action_controller/abstract/exceptions.rb
@@ -1,3 +1,12 @@
module AbstractController
+ class Error < StandardError; end
class ActionNotFound < StandardError; end
+
+ class DoubleRenderError < Error
+ DEFAULT_MESSAGE = "Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like \"redirect_to(...) and return\"."
+
+ def initialize(message = nil)
+ super(message || DEFAULT_MESSAGE)
+ end
+ end
end