Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sentry-ruby/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ config.max_breadcrumbs = 10
- Ignore sentry-trace when tracing is not enabled [#1308](https://github.com/getsentry/sentry-ruby/pull/1308)
- Fixes [#1307](https://github.com/getsentry/sentry-ruby/issues/1307)
- Return nil from logger methods instead of breadcrumb buffer [#1299](https://github.com/getsentry/sentry-ruby/pull/1299)
- Exceptions with nil message shouldn't cause issues [#1327](https://github.com/getsentry/sentry-ruby/pull/1327)
- Fixes [#1323](https://github.com/getsentry/sentry-ruby/issues/1323)

## 4.2.2

Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/interfaces/single_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class SingleExceptionInterface < Interface

def initialize(exception:, stacktrace: nil)
@type = exception.class.to_s
@value = exception.message.byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES)
@value = (exception.message || "").byteslice(0..Event::MAX_MESSAGE_SIZE_IN_BYTES)
@module = exception.class.to_s.split('::')[0...-1].join('::')
@thread_id = Thread.current.object_id
@stacktrace = stacktrace
Expand Down
9 changes: 9 additions & 0 deletions sentry-ruby/spec/sentry/hub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@
end.to raise_error(ArgumentError, 'expect the argument to be a Exception, got String ("String")')
end

# see https://github.com/getsentry/sentry-ruby/issues/1323
it "don't causes error when the exception's message is nil" do
allow(exception).to receive(:message)

expect do
subject.capture_exception(exception)
end.to change { transport.events.count }.by(1)
end

it_behaves_like "capture_helper" do
let(:capture_helper) { :capture_exception }
let(:capture_subject) { exception }
Expand Down