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

[SVLS-4690] Handling panic case #166

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

[SVLS-4690] Handling panic case #166

wants to merge 3 commits into from

Conversation

joeyzhao2018
Copy link
Contributor

@joeyzhao2018 joeyzhao2018 commented Apr 4, 2024

What does this PR do?

Motivation

Fix #165

Testing Guidelines

Added unittest.
Also manually tested:
Screenshot 2024-05-21 at 3 48 57 PM

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Checklist

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 80.43%. Comparing base (39700b5) to head (69547b1).
Report is 2 commits behind head on main.

Current head 69547b1 differs from pull request most recent head d8aaf77

Please upload reports for the commit d8aaf77 to get more accurate results.

Files Patch % Lines
internal/wrapper/wrap_handler.go 42.85% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
- Coverage   80.55%   80.43%   -0.12%     
==========================================
  Files          13       13              
  Lines         905      910       +5     
==========================================
+ Hits          729      732       +3     
- Misses        145      146       +1     
- Partials       31       32       +1     

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

@joeyzhao2018 joeyzhao2018 changed the title Handling panic case [SVLS-4690] Handling panic case Apr 4, 2024
@joeyzhao2018 joeyzhao2018 marked this pull request as ready for review May 21, 2024 15:17
@joeyzhao2018 joeyzhao2018 requested a review from a team as a code owner May 21, 2024 15:17
if r := recover(); r != nil {
response = nil
errResponse = fmt.Errorf("Panic: %v", r)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that since we do not re-panic, we're actually changing how a panicking function functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh, I have the very same concern.
I think the alternative would be to re-panic after we send the trace.

defer func() {
        if r := recover(); r != nil {
            // send the trace somehow 
            panic(r)
        }
    }()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle panic in handle code?
3 participants