bug #38645 [PropertyAccess] forward the caught exception (xabbuh)

This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyAccess] forward the caught exception

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38621
| License       | MIT
| Doc PR        |

Commits
-------

143f82ef8e forward the caught exception
This commit is contained in:
Fabien Potencier 2020-10-20 19:18:02 +02:00
commit aafad690de

View File

@ -115,7 +115,7 @@ class PropertyAccessor implements PropertyAccessorInterface
return;
} catch (\TypeError $e) {
self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0, $propertyPath);
self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0, $propertyPath, $e);
// It wasn't thrown in this class so rethrow it
throw $e;
}