lib/opentelemetry/context/propagation/composite_propagator.rb in opentelemetry-api-0.3.0 vs lib/opentelemetry/context/propagation/composite_propagator.rb in opentelemetry-api-0.4.0

- old
+ new

@@ -36,16 +36,14 @@ # the carrier to respond to [] and []=. # # @return [Object] carrier def inject(carrier, context = Context.current, &setter) @injectors.inject(carrier) do |memo, injector| - begin - injector.inject(memo, context, &setter) - rescue => e # rubocop:disable Style/RescueStandardError - OpenTelemetry.logger.warn "Error in CompositePropagator#inject #{e.message}" - carrier - end + injector.inject(memo, context, &setter) + rescue => e # rubocop:disable Style/RescueStandardError + OpenTelemetry.logger.warn "Error in CompositePropagator#inject #{e.message}" + carrier end end # Runs extractors in order and returns a Context updated with the # results of each extraction. If an extraction fails, a warning will be @@ -61,15 +59,13 @@ # # @return [Context] a new context updated with state extracted from the # carrier def extract(carrier, context = Context.current, &getter) @extractors.inject(context) do |ctx, extractor| - begin - extractor.extract(carrier, ctx, &getter) - rescue => e # rubocop:disable Style/RescueStandardError - OpenTelemetry.logger.warn "Error in CompositePropagator#extract #{e.message}" - ctx - end + extractor.extract(carrier, ctx, &getter) + rescue => e # rubocop:disable Style/RescueStandardError + OpenTelemetry.logger.warn "Error in CompositePropagator#extract #{e.message}" + ctx end end end end end