From 99e52ae7b1c621069f2971d2f352822f263efb49 Mon Sep 17 00:00:00 2001 From: Guilherme Mansur Date: Wed, 19 Jun 2019 13:42:52 -0400 Subject: Autoload SyntaxErrorInTemplate When a SyntaxError is detected in a template we raise this exception. On a first request to the server the exception we get a NameError since the exception is not required from `active_view/template/error.rb` yet. However later on it gets required and a second request will succeed. On the first request we see the rails "Something Wen Wrong" page and not the expected syntax error in template error page with the webconsole and stacktrace. By autoloading the constant we fix this issue. Co-authored-by: Gannon McGibbon --- actionview/lib/action_view.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view.rb b/actionview/lib/action_view.rb index 7f85bf2a5e..11b4563548 100644 --- a/actionview/lib/action_view.rb +++ b/actionview/lib/action_view.rb @@ -77,6 +77,7 @@ module ActionView autoload :ActionViewError autoload :EncodingError autoload :TemplateError + autoload :SyntaxErrorInTemplate autoload :WrongEncodingError end end -- cgit v1.2.3