Closed migo315 closed 4 years ago
Hi @migo315
Thanks for the PR. We plan to look into this and consider whether we want to use this approach across our PHP integrations.
I can split this this if you like. Interface and Trait to bugsnag-php
. Then all additional php libraries can use the Interface and Trait (Symfony, Laravel etc).
@migo315 That sounds really useful if you have the time. To be clear, with our current priorities it will be at least a few weeks until we're able to have a detailed look at your PR and there would be work on our side to document this and ensure we're happy with the interface and test coverage. So in the short term you may want to fork the repository to make use of your own changes, but we do like the approach so are likely to take this on once we have the bandwidth.
Also, a word of caution. We currently support PHP 5.2+ and I believe Traits only came in 5.4, so we'd need to ensure we consider the best way to handle that.
I've created an PR for your PHP SDK https://github.com/bugsnag/bugsnag-php/pull/574
This has now been fixed via php release V3.21.0
https://github.com/bugsnag/bugsnag-php/releases/tag/v3.21.0.
running composer update bugsnag/bugsnag
will pull in latest version
We have added support for the getting the original error on which you can attach additional metadata.
Goal
Provide a very simple way to extend an exception with additional meta data everywhere without further dependencies.
Design
This feature is very pragmatic and straightforward. Similar to PSR Logger, we provide a
MetaDataAwareInterface
and aMetaDataAwareTrait
. The developer can (but must not) extend his Exceptions with the Interface / Trait to add some additional informations:Later just pass your informations:
This implementation does not need any services or heavy structures.
Changeset
Added
Changed
Tests
I have added automatic tests (with and without meta data)
Review
For the submitter, initial self-review:
For the pull request reviewer(s), this changeset has been reviewed for: