bug #35722 [HttpKernel] Set previous exception when rethrown from controller resolver (danut007ro)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.
Discussion
----------
[HttpKernel] Set previous exception when rethrown from controller resolver
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
If an `\InvalidArgumentException` is catched by ControllerResolver a new one is thrown. The old exception is not added as `previous` parameter on the new one so it is not visible on the exception page. This pull request adds old exception as previous on the new one, so it is also visible on the exception page.
Thank you.
Commits
-------
87d51c1e4b
Set previous exception when rethrown from controller resolver
This commit is contained in:
commit
1a51d34d8c
@ -88,7 +88,7 @@ class ControllerResolver implements ArgumentResolverInterface, ControllerResolve
|
|||||||
try {
|
try {
|
||||||
$callable = $this->createController($controller);
|
$callable = $this->createController($controller);
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s', $request->getPathInfo(), $e->getMessage()));
|
throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable. %s', $request->getPathInfo(), $e->getMessage()), 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $callable;
|
return $callable;
|
||||||
|
Reference in New Issue
Block a user