From 7d9ab564df722e2218617e7f2a7e44bd83aec733 Mon Sep 17 00:00:00 2001 From: Alistair Laing Date: Tue, 2 Jan 2024 08:05:08 +0000 Subject: [PATCH] ruby 3.3 does not inspect an object when an exception is raised NoMethod error usess a lot of CPU calling inspect on an object that has raised the error. In ruby 3.3 inspect has been removed and now the exception will only contain the objects name that had the issue instead of inspecting it. see https://github.com/ruby/ruby/blob/v3_3_0/NEWS.md#compatibility-issues ``` Error message for NoMethodError have changed to not use the target object's #inspect for efficiency, and says "instance of ClassName" instead. [Feature #18285] ([1] * 100).nonexisting ``` --- spec/integration/sentry_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/integration/sentry_spec.rb b/spec/integration/sentry_spec.rb index a88ea0cda..f46ed7dec 100644 --- a/spec/integration/sentry_spec.rb +++ b/spec/integration/sentry_spec.rb @@ -44,12 +44,8 @@ expect(filtered_event.to_hash.to_s).not_to include "submission-email@test.example" end - it "replaces the email address in the exception with a comment" do - expect(filtered_event.to_hash[:exception][:values].first[:value]).to include "[Filtered (client-side)]" - end - it "keeps the rest of the exception message" do - expect(filtered_event.to_hash[:exception][:values].first[:value]).to include "undefined method" + expect(filtered_event.to_hash[:exception][:values].first[:value]).to eq "undefined method `not_a_method' for an instance of Form (NoMethodError)" end end