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

feat: Added recovery handler #231

Closed
wants to merge 2 commits into from
Closed

Conversation

flc1125
Copy link
Contributor

@flc1125 flc1125 commented Jul 4, 2023

📑 Description

I can define a general or global recovery that catches system-level exceptions and identifies those that can be reported.

Example: unit test,

✅ Checks

  • My pull request adheres to the code style of this project
  • All the tests have passed

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 93.58% and project coverage change: +0.15 🎉

Comparison is base (989ae8b) 62.76% compared to head (6b61843) 62.91%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #231      +/-   ##
==========================================
+ Coverage   62.76%   62.91%   +0.15%     
==========================================
  Files         128      130       +2     
  Lines        8314     8345      +31     
==========================================
+ Hits         5218     5250      +32     
  Misses       2735     2735              
+ Partials      361      360       -1     
Impacted Files Coverage Δ
schedule/service_provider.go 0.00% <0.00%> (ø)
support/database/database.go 79.31% <0.00%> (ø)
contracts/foundation/service_provider.go 50.00% <50.00%> (ø)
support/debug/recovery/panic_handler.go 50.00% <50.00%> (ø)
schedule/application.go 94.33% <100.00%> (+1.15%) ⬆️
schedule/event.go 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hwbrzzl
Copy link
Contributor

hwbrzzl commented Jul 4, 2023

Thanks for your PR, please add the Review Ready label when this PR can be reviewed.

"github.com/goravel/framework/contracts/support/debug/recovery"
)

type PanicHandler struct{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Can you please give an example for how to use this in goravel/goravel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It involves my another discussion: goravel/goravel#209

My idea is to have a Kernel to start the entire application, and this startup is a root command.

I can configure the recovery from this root command.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, let's discuss it at goravel/goravel#209

@flc1125
Copy link
Contributor Author

flc1125 commented Jul 6, 2023

Since this discussion(goravel/goravel#209) is closed, this one is closed as well. But if there are new ideas, we can always continue to discuss them.

Welcome, everybody.

@flc1125 flc1125 closed this Jul 6, 2023
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.

2 participants