Skip to content
This repository
Browse code

revised the exception message "Expected #{file_path} to define #{qual…

…ified_name}"

Users need to know the ultimate problem here is that AS was
trying to autoload a constant and it failed.
  • Loading branch information...
commit 5388fee718994adabfde20020652d03d67d97048 1 parent 70f147d
Xavier Noria authored September 04, 2012
2  activesupport/lib/active_support/dependencies.rb
@@ -487,7 +487,7 @@ def load_missing_constant(from_mod, const_name)
487 487
           raise "Circular dependency detected while autoloading constant #{qualified_name}"
488 488
         else
489 489
           require_or_load(expanded)
490  
-          raise LoadError, "Expected #{file_path} to define #{qualified_name}" unless from_mod.const_defined?(const_name, false)
  490
+          raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it" unless from_mod.const_defined?(const_name, false)
491 491
           return from_mod.const_get(const_name)
492 492
         end
493 493
       elsif mod = autoload_module!(from_mod, const_name, qualified_name, path_suffix)

0 notes on commit 5388fee

Please sign in to comment.
Something went wrong with that request. Please try again.