Permalink
Browse files

[close #6217] Warn when generator cannot load

If a generator has an error we should display that error rather than swallowing it while allowing other generator sot be listed. This is useful while developing a generator.
  • Loading branch information...
1 parent f2a44ad commit b1393a720b03677d6ec463782a2ebce031a1d03a @schneems committed Sep 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/lib/rails/generators.rb
@@ -299,8 +299,8 @@ def self.lookup! #:nodoc:
begin
path = path.sub("#{base}/", "")
require path
- rescue Exception
- # No problem
+ rescue Exception => e
+ warn "[WARNING] Could not load generator #{path.inspect}. Error: #{e.message}.\n#{e.backtrace.join("\n")}"
end
end
end

0 comments on commit b1393a7

Please sign in to comment.