diff --git a/lib/better_errors/raised_exception.rb b/lib/better_errors/raised_exception.rb index 4057d5bf..b01c0ba2 100644 --- a/lib/better_errors/raised_exception.rb +++ b/lib/better_errors/raised_exception.rb @@ -4,7 +4,9 @@ class RaisedException attr_reader :exception, :message, :backtrace def initialize(exception) - if exception.respond_to?(:original_exception) && exception.original_exception + if exception.respond_to?(:cause) && exception.cause + exception = exception.cause + elsif exception.respond_to?(:original_exception) && exception.original_exception exception = exception.original_exception end