From becdad97751e26e0f480388f7e5708ebde0850b1 Mon Sep 17 00:00:00 2001 From: Marcelo Jacobus Date: Tue, 23 Jan 2024 16:34:19 -0300 Subject: [PATCH] Remove error suppression in `render_in` We should be able to se error pages, specially in when Rails.env is development. The piece of code that was removed here prevented from happening. Instead, it would have the `render_in` method return `nil` when an error happened, resulting in either a blank page, or an incomplete page. I believe we also want to raise errors in production. We should not make a decision here, whether the error should be suppressed. Otherwise we are making the assumption "incomplete pages are better than error pages", which may be the correct assumption under some circumstances, but not under other circumstances. Fixes https://github.com/ViewComponent/view_component/issues/1981 --- .../agent/instrumentation/view_component/instrumentation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb b/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb index a95f31dee7..71488ca9d0 100644 --- a/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +++ b/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb @@ -15,7 +15,8 @@ def render_in_with_tracing(*args) ) yield rescue => e - ::NewRelic::Agent.logger.debug('Error capturing ViewComponent segment', e) + NewRelic::Agent.notice_error(e) + raise ensure segment&.finish end