Skip to content

Conversation

@st0012
Copy link
Collaborator

@st0012 st0012 commented Aug 20, 2020

This fixes #938
It also contains some code removal and test coverage improvements.

st0012 added 4 commits August 20, 2020 19:40
If we take a look at `Raven::Instance#capture_exception`, we can see
that it now always returns an Event or nil/false.

```ruby
if evt = Event.send("from_" + message_or_exc, obj, options)
  yield evt if block_given?
  if configuration.async?
    begin
      # We have to convert to a JSON-like hash, because background job
      # processors (esp ActiveJob) may not like weird types in the event hash
      configuration.async.call(evt.to_json_compatible)
    rescue => e
      logger.error("async event sending failed: #{e.message}")
      send_event(evt, make_hint(obj))
    end
  else
    send_event(evt, make_hint(obj))
  end
  Thread.current["sentry_#{object_id}_last_event_id".to_sym] = evt.id
  evt # <- here
end
```

So all the conditions for Thread/Hash objects can now be removed.
@st0012 st0012 added this to the 3.0.3 milestone Aug 20, 2020
@st0012 st0012 self-assigned this Aug 20, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2020

Codecov Report

Merging #989 into master will increase coverage by 0.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #989      +/-   ##
==========================================
+ Coverage   97.26%   97.76%   +0.49%     
==========================================
  Files          46       46              
  Lines        2123     2148      +25     
==========================================
+ Hits         2065     2100      +35     
+ Misses         58       48      -10     
Impacted Files Coverage Δ
lib/raven/cli.rb 86.20% <100.00%> (+26.20%) ⬆️
spec/raven/cli_spec.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9645f8...3afd601. Read the comment docs.

@st0012 st0012 merged commit 7d8938c into master Aug 20, 2020
@st0012 st0012 deleted the fix-raven-cli branch August 20, 2020 13:41
@st0012 st0012 mentioned this pull request Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rake raven:test does not work if environments are specified in config

2 participants