Fix issue where exceptions triggered by extensions could be silently swallowed #232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Something I overlooked in #229.
Logging::getLogger()
uses the default logging service,SilverStripe\Omnipay\Logger
. If that has been set to aNullLogger
as per the instructions in added #229, then exceptions thrown duringsafeExtend()
can be swallowed in live mode.This change ensures that if a separate logger is set up for fatal errors (as described in #229), it will be used by
safeExtend()
andsafeguard()
so that exceptions can still be logged. As per the other pull request, if no separate Injector service has been set up forSilverStripe\Omnipay\ExceptionLogger
then it inherits fromSilverStripe\Omnipay\Logger
instead:silverstripe-omnipay/_config/logging.yml
Line 7 in a44ee69
I’ve pushed a 3.1 branch for this, so it can be tagged as 3.1.2 without including the other changes that are currently in master.