lib/goliath/application.rb in goliath-0.9.0 vs lib/goliath/application.rb in goliath-0.9.1

- old
+ new

@@ -43,10 +43,14 @@ # Execute the application # # @return [Nil] def self.run! file = File.basename(app_file, '.rb') - klass = Kernel.const_get(camel_case(file)) + klass = begin + Kernel.const_get(camel_case(file)) + rescue NameError + raise NameError, "Class #{camel_case(file)} not found." + end api = klass.new runner = Goliath::Runner.new(ARGV, api) runner.load_app do klass.middlewares.each do |mw|