-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
FlattenException incompatibility with Sf2.3 #565
Conversation
Have to add that the problem is not there on |
|
Not sure what they will be doing in the symfony/symfony repo, I think it's better to wait for them to take a decision |
This should be merged in any case. Independent of the decision in symfony. |
To |
Still the dependency is ~2.3 as the class was introduced in 2.3 and it should also work in 2.3. Or not? |
Ah sorry, the exception controller is not extending the TwigBundle one anyway, so typehint the new class would indeed work |
I would prefer dropping the type hint and then checking manually if its one of the possible |
btw .. while you are at it .. could you also look into this change here https://github.com/symfony/symfony/pull/9155/files and if its relevant to this controller too? |
@lsmith77 agree that dropping type hinting is not ideal but probably the most viable solution here, will come up with something in a bit |
@lsmith77 why do you need different branches? I don't see the need. The dependencies got raised but that does not require a new branch. Unless you really want to have a maintenance branch for symfony < 2.3. But symfony 2.2 is only maintained itself for 2 more month. |
I would like to maintain BC unless there is a really good reason to move on. This doesn't seem like a good reason to move on. |
@Tobion As 2.2 is still maintained, we wtill need to maintain a version of the bundle compatible with it |
@lsmith77 it's not possible to maintain bc here. That's the same problem as in symfony/symfony#9145. Removing the typehint is also a bc break for people extending the class/method. |
I can live with this BC break as we are not yet at 1.0.0 stable. its an easy enough fix :) |
@stof so all FOS bundles have the same maintenance process as symfony itself? That's probably pretty hard to achieve considering there a less people involved to maintain all the bundles than for symfony. And it should probably be documented that there is version of each bundle maintained for each symfony minor version. |
@Tobion No, we try as much as possible to have 1 version of the bundle compatible with all Symfony versions (it is possible most of the time now that 2.0 does not need to be supported anymore) |
What about all the reference to |
i guess use the fcqn and separate with |
@stof that means yes, you have a version of each bundle maintained for each symfony minor version. In this case it's only one branch. But I questioned when you said that symfony 2.2 is still maintained, we also need to maintain the rest bundle. This means we cannot just drop symfony 2.2 support for fos rest bundle from now on. Although to me we could do so and follow our own maintenance process because this is an independent "organisation". |
generally the effort isn't too big and the compromises not that significant so yes its usually possible to support all currently maintained symfony versions with one branch. aside from this, i would also only break BC with a non maintained version for a good reason. |
@Tobion Well, if we were already having a stable release of the bundle, I would be fine with bumping the requirement in the dev version as we would still have a version compatible with 2.2 (the stable one). but we would still need to provide patch releases based on this stable version until the EOL of Symfony 2.2, otherwise we would simply be ignoring some of our users (by forcing them to upgrade Symfony to get a maintained version of the bundle). I don't think we can afford ignoring users of maintained Symfony version for bundles, as bundles are plugins for Symfony. It would not be a good behavior IMO. However, I don't understand what you mean with "our own maintenance process". |
let me know guys |
looks good to me. |
* @param $exception | ||
* @throws \InvalidArgumentException | ||
*/ | ||
protected function validateException($exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would inline this code. It's only called once and should not be protected anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed
… and manually checking the exception type
@lsmith77 done |
ah one last thing .. can you add a note about the BC break into the UPGRADING.md? |
from |
yes |
done, will you also tag? |
see #566 |
FlattenException incompatibility with Sf2.3
Guys, I just performed these updates: My Exceptions are no longer being processed by FOS\RestBundle\Controller\ExceptionController::showAction. Instead of getting a json object with the Status Code and the Exception Message I get the html response: I stepped through with the debugger to confirm that my controller is in fact throwing the exception My config.yml contains Is this related to this issue? Any advice? |
I downgraded back to Symfony 2.3.4 and FOS\RestBundle\Controller\ExceptionController is handling my exceptions again. Let me know if you need me to provide information about my system. |
@iagomez Yes it is related. As this has been merged, you can update FOSRestBundle to its dev version and it should work with 2.3.5 |
@stof Thank you. |
Hey guys, not sure if this is the best approach, as it requires dropping backwards compatibility.
Basically in Symfony2.3, afaik, they introduce a new debug component. The FlattenException has been moved there, and for BC what they did is to keep the one in HttpFoundation, by making it extend the one in Debug.
That's cool but then this Exception controller intercepts internal exceptions from Sf2, and the Exceptions thrown are the ones from the Debug component. Therefore you get amazing things like:
I just noticed it after updating our libs via composer. Am I missing something?
Dunno your thoughts about this, just suggesting to find a quick fix :)