CallableResolver call is wrapped in a catch that expects RuntimeException
|
if ($this->callableResolver instanceof CallableResolverInterface) { |
|
try { |
|
$callable = $this->callableResolver->resolve($this->middleware); |
|
} catch (RuntimeException $e) { |
|
// Do Nothing |
|
} |
|
} |
|
|
|
if (!$callable) { |
If a resolver throws exception that doesn't extend from RuntimeException this halts the execution and fallback code below is never reached.
Real example of the issue with third party resolver: PHP-DI/Slim-Bridge#51
I am not sure what's the reasoning for specifically RuntimeException here, but broadening it to Exception might be a good idea for resilience?
CallableResolvercall is wrapped in a catch that expectsRuntimeExceptionSlim/Slim/MiddlewareDispatcher.php
Lines 214 to 222 in 8294d20
If a resolver throws exception that doesn't extend from
RuntimeExceptionthis halts the execution and fallback code below is never reached.Real example of the issue with third party resolver: PHP-DI/Slim-Bridge#51
I am not sure what's the reasoning for specifically
RuntimeExceptionhere, but broadening it toExceptionmight be a good idea for resilience?