Skip to content

Commit

Permalink
check if exception responds to #original_exception instead of hard co…
Browse files Browse the repository at this point in the history
…ding a class
  • Loading branch information
Charlie Somerville committed Dec 8, 2012
1 parent 502f9fe commit a3edf53
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/better_errors/error_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a3edf53

Please sign in to comment.