-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore legacy mapper exceptions when there is no database #79
Conversation
No candidates for more specifc catch? |
Other than gracefully handling it in the kernel itself, no, not really. |
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.
Ok then :)
Free to merge? :) |
last review needed, ping @glye @bdunogier |
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.
"Most probable cause for error" looks dodgy, but if you have looked into it and see no more specific exception to use and no other likely error that can end up ignored by the same code, then I guess it's ok.
Wishlist: Logging and/or console warning.
Yeah, the only time I ran into the issue was when database was not available and it only happened on first composer install of a project that has legacy bridge preinstalled. What happens is a straight SQL execution exception, so it is not handled by eZ kernel in any way. I can add logging though :) |
So then this change could have catched that exception instead, or? (that is what both @glye and me are saying we would prefer here) |
There's an example in the comments here for catching |
I know what you mean @andrerom and @glye, I'm not a fan of use of global exceptions, but as I said, since this happens in a very specific situation, where there is no database present and nowhere else, there is not much left to do. One more specific error to catch would be |
Right. |
It is :D ☠️ |
true, exception conversion :| ok, then merge it is then. |
@andrerom Thanks :) Now that this is out of the way, can I tag |
Feel free :) |
👍 |
The exception thrown here breaks
composer install
when there is no database, for example, when doing an initial installation of a repo which includes the legacy bridge.