Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rails] support string errors in error reporter #2464

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

solnic
Copy link
Collaborator

@solnic solnic commented Nov 14, 2024

Closes #2460

@solnic solnic linked an issue Nov 14, 2024 that may be closed by this pull request
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (5de4ebc) to head (af8e14a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2464   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files         126      126           
  Lines        4761     4765    +4     
=======================================
+ Hits         4672     4676    +4     
  Misses         89       89           
Components Coverage Δ
sentry-ruby 98.51% <ø> (ø)
sentry-rails 97.07% <100.00%> (+0.01%) ⬆️
sentry-sidekiq 96.96% <ø> (ø)
sentry-resque 92.85% <ø> (ø)
sentry-delayed_job 95.65% <ø> (ø)
sentry-opentelemetry 99.31% <ø> (ø)
Files with missing lines Coverage Δ
sentry-rails/lib/sentry/rails/error_subscriber.rb 100.00% <100.00%> (ø)

@solnic solnic marked this pull request as ready for review November 14, 2024 13:19
when Exception
Sentry::Rails.capture_exception(error, **options)
else
raise ArgumentError, "Expected an Exception or a String, got: #{error.inspect}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not raise inside the SDK, let's use log_debug here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sl0thentr0py hmm, what's the best way of accessing logger though? I can see that the helper is defined in the LoggingHelper, but not sure which object I should use for logging, or if I should include that helper in the ErrorSubscriber?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you can just include it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using ActiveSupport::ErrorReporter with capture_message
2 participants