Refactor event interface construction#1296
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1296 +/- ##
===========================================
- Coverage 97.95% 77.32% -20.63%
===========================================
Files 203 42 -161
Lines 8758 1213 -7545
===========================================
- Hits 8579 938 -7641
- Misses 179 275 +96
Continue to review full report at Codecov.
|
f6b52da to
5d42dfa
Compare
This moves the construction logic away from StacktraceInterface and Event classes. It allows users to customize stacktrace construction easier.
The stacktrace interface should be attached on exception or thread interface, not directly the event.
5d42dfa to
edccbe9
Compare
Users can just patch SingleExceptionInterface.build_with_stacktrace to change an exception's stacktrace.
```ruby
builder.build(backtrace) do |frame|
if frame.module.match?(/a_gem/)
nil
else
frame
end
end
```
Keyword arguments give a more clear message on what parameters are expected. This will help extension writers use those classes.
21e3b05 to
e5f22ad
Compare
This was referenced Mar 12, 2021
This was referenced Mar 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StacktraceBuilderto centralizeStacktraceInterface's complex construction.StacktraceBuilder.buildcan be used to customize individual stacktrace frames.Interface.build.Eventclass if they want to handle interfaces differently.