Skip to content

Instantly share code, notes, and snippets.

@michaelklishin
Created August 7, 2008 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelklishin/4431 to your computer and use it in GitHub Desktop.
Save michaelklishin/4431 to your computer and use it in GitHub Desktop.
commit 6697034331fca5a7277207d21bbbe3cd4a091584
Author: Michael S. Klishin <michael@novemberain.com>
Date: Thu Aug 7 18:17:24 2008 +0300
More verbose exception when status value is invalid.
diff --git a/lib/merb-core/controller/merb_controller.rb b/lib/merb-core/controller/merb_controller.rb
index f0db22a..f7e0005 100644
--- a/lib/merb-core/controller/merb_controller.rb
+++ b/lib/merb-core/controller/merb_controller.rb
@@ -220,7 +220,7 @@ class Merb::Controller < Merb::AbstractController
elsif s.is_a?(Fixnum)
@_status = s
else
- raise ArgumentError, "Status should be of type Fixnum or Symbol, was #{s.class}"
+ raise ArgumentError, "Status should be of type Fixnum or known Symbol, was #{s.class} with value #{s}"
end
end
@@ -262,4 +262,4 @@ module Merb::ExceptionsHelper
def humanize_exception(e)
e.class.name.split("::").last.gsub(/([a-z])([A-Z])/, '\1 \2')
end
-end
\ No newline at end of file
+end
commit 12f8e1bbaaed6db993def9ce0f00fba7d6b27eef
Author: Michael S. Klishin <michael@novemberain.com>
Date: Thu Aug 7 18:16:30 2008 +0300
Fixed a problem in new dispatcher.
diff --git a/lib/merb-core/dispatch/dispatcher.rb b/lib/merb-core/dispatch/dispatcher.rb
index 339e990..c8169fd 100644
--- a/lib/merb-core/dispatch/dispatcher.rb
+++ b/lib/merb-core/dispatch/dispatcher.rb
@@ -174,7 +174,7 @@ module Merb
if use_mutex
@@mutex.synchronize { controller._dispatch(request.params[:action]) }
else
- controller._dispatch(action)
+ controller._dispatch(request.params[:action])
end
controller
end
@@ -297,4 +297,4 @@ module Merb
end
end
-end
\ No newline at end of file
+end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment