-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[10.x] Deduplicate exceptions #48288
Conversation
I understand the reasoning; however, this doesn't seem like good practice to me. I believe this issue should be resolved at the application level. Additionally, it raises other questions; as the |
As a WeakMap doesn't hold a reference to the object, we don't need to clear anything. The exception will be garbage collected in the same way it currently is. |
Clever solution with |
Very nice addition @timacdonald ... I implemented a very similar solution 2 weeks ago to an app a client's was always asking about exception's duplicates... Unfortunately it is still a Laravel 8 app, as it still runs on PHP 7.4 on centOS, so I couldn't use a This client is planning to migrate to a newer server later this year, so knowing you already got this covered makes me very happy and eager to finally migrate this app to a newer Laravel version. Thanks a lot! Have a nice day =) |
Really appreciate that feedback, @rodrigopedra ❤️ Hopefully once you get moved over and updated you can delete some code 🎉 |
Hey @timacdonald I told my client about this PR, and he asked me about some other features we might be missing or reimplementing, and... we are migrating the server this weekend to Rocky 9, PHP 8.2 and Laravel 10! well I will be working on migrating the codebase tomorrow and Friday, and he prefers to manage his servers himself So I guess I own you a second thank you =) (and need to stop posting on this thread before being called a spammer 🤐) Thanks again, and may God bless you. Have a nice day! |
yo, @rodrigopedra, if this is spam - sign me up! This is amazing to hear. I love that this feature helped move the discussion forward. Very awesome |
* Deduplicate exceptions * Fix test * lint * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
Adds the ability to deduplicate exception reporting.
Exceptions may sometimes be caught, reported, re-thrown only to be re-reported at a higher level - potentially a few times throughout the application layers.
This adds a lever to the exception handler to deduplicate exceptions to ensure a single instance of an exception is only reported on time.
If the same exception is now reported more than once, it will only actually report a single time.
There is already precedent for this kind of feature in the framework with something like middleware.
The
MyMiddleware
is not executed twice, as the framework deduplicates them for us.