Sha256: 625b4713e5c3613aaf7eb0f80e005a811f2e4aa4ce31310d41ab2ebaf3d2cfa5

Contents?: true

Size: 695 Bytes

Versions: 12

Compression:

Stored size: 695 Bytes

Contents

module MessageDriver
  module Nesty
    module NestedError
      attr_reader :nested, :raw_backtrace

      def initialize(msg = nil, nested)
        super(msg)
        @nested = nested
      end

      def set_backtrace(backtrace)
        @raw_backtrace = backtrace
        if nested
          backtrace = backtrace - nested_raw_backtrace
          backtrace += ["#{nested.backtrace.first}: #{nested.message} (#{nested.class.name})"]
          backtrace += nested.backtrace[1..-1] || []
        end
        super(backtrace)
      end

      private

      def nested_raw_backtrace
        nested.respond_to?(:raw_backtrace) ? nested.raw_backtrace : nested.backtrace
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
message-driver-1.0.1 lib/vendor/nesty/nested_error.rb
message-driver-1.0.0 lib/vendor/nesty/nested_error.rb
message-driver-0.7.2 lib/vendor/nesty/nested_error.rb
message-driver-0.7.1 lib/vendor/nesty/nested_error.rb
message-driver-0.7.0 lib/vendor/nesty/nested_error.rb
message-driver-0.6.1 lib/vendor/nesty/nested_error.rb
message-driver-0.6.0 lib/vendor/nesty/nested_error.rb
message-driver-0.5.3 lib/vendor/nesty/nested_error.rb
message-driver-0.5.2 lib/vendor/nesty/nested_error.rb
message-driver-0.5.1 lib/vendor/nesty/nested_error.rb
message-driver-0.5.0 lib/vendor/nesty/nested_error.rb
message-driver-0.4.0 lib/vendor/nesty/nested_error.rb