test/new_relic/agent/transaction/segment_test.rb
# Similar to capture_segment_with_error, but we're capturing 
# a child/nested segment within which we raise an error
Similar to capture_segment_with_error, but we're capturing
a child/nested segment within which we raise an error
Similar to capture_segment_with_error but we ' re capturing a child / nested segment within which we raise an error
def capture_nested_segment_with_error
          begin
            segment_with_error = nil
            parent_segment = nil
            with_segment do |segment|
              parent_segment = segment
              segment_with_error = Tracer.start_segment(name: "nested_test", parent: segment)
              raise "oops!"
            end            
          rescue Exception => exception
            segment_with_error.finish
            assert segment_with_error, "expected to have a segment_with_error"
            build_deferred_error_attributes segment_with_error
            refute_equal parent_segment, segment_with_error
            return segment_with_error, parent_segment, exception
          end
        end
def capture_nested_segment_with_error begin segment_with_error = nil parent_segment = nil with_segment do | segment | parent_segment = segment segment_with_error = Tracer . start_segment ( name : "nested_test" , parent : segment ) raise "oops!" end rescue Exception => exception segment_with_error . finish assert segment_with_error , "expected to have a segment_with_error" build_deferred_error_attributes segment_with_error refute_equal parent_segment , segment_with_error return segment_with_error , parent_segment , exception end end
Similar to capture_segment_with_error, but we're capturing
a child/nested segment within which we raise an error
Similar to capture_segment_with_error but we ' re capturing a child / nested segment within which we raise an error