diff --git a/lib/better_errors/error_page.rb b/lib/better_errors/error_page.rb index b23712b7..a4d86e2b 100644 --- a/lib/better_errors/error_page.rb +++ b/lib/better_errors/error_page.rb @@ -23,12 +23,10 @@ def render private def real_exception(exception) - loop do - case exception - when ActionView::Template::Error; exception = exception.original_exception - else - return exception - end + if exception.respond_to? :original_exception + exception.original_exception + else + exception end end