Skip to content

Commit b1f9e0e

Browse files
authored
Fix exception listener with Symfony 4.3 (#301)
* Add Symfony 4.3 as a new job in CI * Fix listener registration * Add changelog entry
1 parent 7796f46 commit b1f9e0e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
env:
3535
- SYMFONY_VERSION: 3.4.*
3636
- SYMFONY_DEPRECATIONS_HELPER: disabled
37+
- php: 7.3
38+
env: SYMFONY_VERSION=4.3.*
3739
- php: 7.3
3840
env: SYMFONY_VERSION=4.4.*
3941
- php: 7.4

CHANGELOG.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## Unreleased
88
- ...
99

10-
## 3.3.1 (2020-01-14)
10+
## 3.3.1 (2020-01-16)
11+
- Fix issue with exception listener under Symfony 4.3 (#301)
1112

13+
## 3.3.1 (2020-01-14)
1214
- Fixed Release
1315

1416
## 3.3.0 (2020-01-14)
@@ -22,7 +24,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2224
- Fixed undefined variable in `RequestListener` (#263)
2325

2426
## 3.2.0 (2019-10-04)
25-
2627
- Add forward compatibility with Symfony 5 (#235, thanks to @garak)
2728
- Fix Hub initialization for `ErrorListener` (#243, thanks to @teohhanhui)
2829
- Fix compatibility with sentry/sentry 2.2+ (#244)
@@ -32,20 +33,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3233
- Add options to register the Monolog Handler (#247, thanks to @HypeMC)
3334

3435
## 3.1.0 (2019-07-02)
35-
3636
- Add support for Symfony 2.8 (#233, thanks to @nocive)
3737
- Fix handling of ESI requests (#213, thanks to @franmomu)
3838

3939
## 3.0.0 (2019-05-10)
40-
4140
- Add the `sentry:test` command, to test if the Sentry SDK is functioning properly.
4241

4342
## 3.0.0-beta2 (2019-03-22)
44-
4543
- Disable Sentry's ErrorHandler, and report all errors using Symfony's events (#204)
4644

4745
## 3.0.0-beta1 (2019-03-06)
48-
4946
The 3.0 major release has multiple breaking changes. The most notable one is the upgrade to the 2.0 base SDK client.
5047
Refer to the [UPGRADE-3.0.md](https://github.com/getsentry/sentry-symfony/blob/master/UPGRADE-3.0.md) document for a
5148
detailed explanation.

phpstan.neon

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
- test/
66
ignoreErrors:
77
- "/Call to function method_exists.. with 'Symfony.+' and 'getRootNode' will always evaluate to false./"
8+
- "/Call to function method_exists.. with 'Symfony.+' and 'getThrowable' will always evaluate to false./"
89
- "/Call to function method_exists.. with 'Sentry..Options' and 'getClassSerializers' will always evaluate to false./"
910
- "/Call to function method_exists.. with 'Sentry..Options' and 'getMaxRequestBodySi...' will always evaluate to false./"
1011
- '/Class PHPUnit_Framework_TestCase not found/'

src/DependencyInjection/SentryExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function configureErrorListener(ContainerBuilder $container, array $proc
150150
private function tagExceptionListener(ContainerBuilder $container): void
151151
{
152152
$listener = $container->getDefinition(ErrorListener::class);
153-
$method = class_exists(ExceptionEvent::class)
153+
$method = class_exists(ExceptionEvent::class) && method_exists(ExceptionEvent::class, 'getThrowable')
154154
? 'onException'
155155
: 'onKernelException';
156156

0 commit comments

Comments
 (0)