Skip to content

Add Sentry.with_exception_captured helper#1814

Merged
st0012 merged 3 commits intomasterfrom
add-with_exception_captured-helper
May 20, 2022
Merged

Add Sentry.with_exception_captured helper#1814
st0012 merged 3 commits intomasterfrom
add-with_exception_captured-helper

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@st0012 st0012 commented May 8, 2022

This PR adds the Sentry.with_exception_captured helper to simplify exception rescuing/reporting logic:

Sentry.with_exception_captured do
 1/1 #=> 1 will be returned
end

Sentry.with_exception_captured do
 1/0 #=> ZeroDivisionError will be reported and re-raised
end

It's the same as:

begin
  my_code
rescue Exception => e
  Sentry.caputre_exception(e)
  raise
end

@st0012 st0012 added this to the 5.4.0 milestone May 8, 2022
@st0012 st0012 self-assigned this May 8, 2022
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (daeb133) to head (2ea8d21).
⚠️ Report is 548 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1814      +/-   ##
==========================================
+ Coverage   98.45%   98.46%   +0.01%     
==========================================
  Files         145      145              
  Lines        8661     8675      +14     
==========================================
+ Hits         8527     8542      +15     
+ Misses        134      133       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@st0012 st0012 requested a review from sl0thentr0py May 8, 2022 21:13
@st0012 st0012 force-pushed the add-with_exception_captured-helper branch from 50a7ef0 to 566e548 Compare May 8, 2022 21:38
@st0012 st0012 merged commit d95e30b into master May 20, 2022
@st0012 st0012 deleted the add-with_exception_captured-helper branch May 20, 2022 21:13
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.

3 participants