Resolving middleware breaks if resolver throws unexpected exception type
Author: RarstCreated Apr 21, 2021Updated Apr 26, 2021
LabelsSlim 4Slim 5
CallableResolver call is wrapped in a catch that expects RuntimeException
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: https://github.com/PHP-DI/Slim-Bridge/issues/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?
Source: slimphp/Slim