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

Exceptions with message set to nil cause Sentry.capture_error(e) to fail with NoMethodError: undefined method `byteslice' for nil:NilClass #1323

Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Mar 10, 2021

Describe the bug

Stripe gem has following class:

class StripeError < StandardError

which overrides StandardError initialize method with followng:

def initialize(message = nil, http_status: nil, http_body: nil,
                   json_body: nil, http_headers: nil, code: nil)

it overrides StandardError default behaviour of setting default exception message
to class name of the error.

Exceptions with message set to nil cause sentry-ruby gems method:

Sentry.capture_error(e)

to fail with
NoMethodError: undefined method `byteslice' for nil:NilClass

To Reproduce

Described above.

Expected behavior

Correct capture of exception.

Actual behavior

Described above.

Environment

  • Ruby Version: 2.7.2
  • SDK Version:

sentry-rails (4.2.2)
sentry-ruby (4.2.2)
sentry-ruby-core (4.2.2)
sentry-sidekiq (4.2.1)

  • Integration Versions (if any):

rails (6.1.3)
activejob (6.1.3)
sidekiq (6.1.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment