diff options
author | Rick Olson <technoweenie@gmail.com> | 2008-02-07 02:45:13 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2008-02-07 02:45:13 +0000 |
commit | 57cea9c9459a3e6d5cb857c8ca1d2026e8b39526 (patch) | |
tree | 8cd88929f9535c0936e3ecb33c9d78809a4cefb4 /actionpack/lib/action_view/template_finder.rb | |
parent | cfb8ba00037296054543fb6f0c5863869fdf072d (diff) | |
download | rails-57cea9c9459a3e6d5cb857c8ca1d2026e8b39526.tar.gz rails-57cea9c9459a3e6d5cb857c8ca1d2026e8b39526.tar.bz2 rails-57cea9c9459a3e6d5cb857c8ca1d2026e8b39526.zip |
Add a slightly more informative exception message for ActionView::TemplateFinder::InvalidViewPath [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8809 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/template_finder.rb')
-rw-r--r-- | actionpack/lib/action_view/template_finder.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template_finder.rb b/actionpack/lib/action_view/template_finder.rb index d88832ef7e..648fdf43e8 100644 --- a/actionpack/lib/action_view/template_finder.rb +++ b/actionpack/lib/action_view/template_finder.rb @@ -2,6 +2,11 @@ module ActionView #:nodoc: class TemplateFinder #:nodoc: class InvalidViewPath < StandardError #:nodoc: + attr_reader :unprocessed_path + def initialize(path) + @unprocessed_path = path + super("Unprocessed view path found: #{@unprocessed_path.inspect}. Set your view paths with #append_view_path, #prepend_view_path, or #view_paths=.") + end end cattr_reader :processed_view_paths @@ -157,7 +162,7 @@ module ActionView #:nodoc: def check_view_paths(view_paths) view_paths.each do |path| - raise(InvalidViewPath, "Unprocessed view path found in #{view_paths.inspect}") unless @@processed_view_paths.has_key?(path) + raise InvalidViewPath.new(path) unless @@processed_view_paths.has_key?(path) end end |