Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
Exceptions are now normalized inside the Routing Component and implement Symfony\Component\Routing\Exception\ExceptionInterface
Why is that necessary and what is it good for?
@Tobion we agreed 1 year ago about using component specific exceptions, but existing components were not all converted to this way.
BTW Travis build fails on upstream error, tests are ok in the routing scope on my local clone
@stof but what is it good for? There good reasons to create sub-classes for special exceptions like RouteNotFoundException. But I see no point in duplicating all SPL exceptions for all components.
Thats like 23 components * 13 SPL exceptions = 299 redundant classes.
It allows you catching an exception by scope. This is often used in some lib like Imagine or ZF2
How is it useful to catch an exception like one raised by the RouteCompiler? There is reason why the exception is thrown because there is no way to proceed and the code needs to be fixed. Even if you catch a LogicException you still don't know what excactly was the problem because there are several errors that lead to an LogicException. So you cannot fix it automatically anyway.
Normalize exceptions in Routing Component
@fabpot what about this ? I was going to normalize components exceptions (scope exceptions per component). If it's not something required for symfony, let's close this one. Otherwise, I'll check the other components in a near future
I tend to agree with @Tobion here. Indeed, we decided to use specific exceptions in components, but only when it makes sense. Converting all components to use specific exceptions is not desirable if there is no point in doing that. So, I'm closing this PR.