-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Catch statement in service manager should handle any exception code #26
Comments
Whole story to this point is writte in the first comment here: http://php.net/manual/en/class.pdoexception.php Question to be asked is: Originally posted by @manuakasam at zendframework/zend-servicemanager#41 (comment) |
As I've said on IRC, I'll not loose my time with PHP dev team by reporting bugs on their bug tracker due to their EGO (and so on...). For the record
In short: The PHP dev team does not hesitate to violate its own interfaces (by laziness?) Originally posted by @nuxwin at zendframework/zend-servicemanager#41 (comment) |
Not really, it's mostly because many of the core members of PHP-DEV are still attached to very old practices that aren't really considered "good" anymore. Originally posted by @Ocramius at zendframework/zend-servicemanager#41 (comment) |
This looks like it has been forgotten. Is this still an issue to resolve? Originally posted by @spengilley at zendframework/zend-servicemanager#41 (comment) |
You mean in ZF3? I don't know. Even through, we can handle this problem locally by catching the exception. Originally posted by @nuxwin at zendframework/zend-servicemanager#41 (comment) |
@nuxwin Thanks for responding. I was talking specifically in ZF2. I am looking for some easy issues to fix. I am new to contributing to open source :) Originally posted by @spengilley at zendframework/zend-servicemanager#41 (comment) |
Not the best issue to start ;) From my point of view, this issue can be closed. Originally posted by @nuxwin at zendframework/zend-servicemanager#41 (comment) |
Why would you catch any exceptions in the service manager and re-throw generic, useless exceptions instead of leaving the proper exceptions to bubble up and be caught as needed by the user? If I had a penny for everytime the useless exceptions from the service manager were thrown and I had no clue what went wrong, I'd be rich. Maybe you should reconsider this in the future. Originally posted by @lucian303 at zendframework/zend-servicemanager#41 (comment) |
You can rely on this type from a caller in order to wrap the DIC and write fallback logic. If everything was a If the problem is dealing with "previous exceptions", then my suggestions is to get up to speed with that concept, and quickly, since most good OO libraries out there do wrap exceptions in known failure scenarios. Originally posted by @Ocramius at zendframework/zend-servicemanager#41 (comment) |
Anyway, if anybody wants to pick this up, write a test with a factory that does something like this: (function (Potato $foo) {})();
```
Then verify that the type of the error is indeed a `ServiceNotCreated`.
---
Originally posted by @Ocramius at https://github.com/zendframework/zend-servicemanager/issues/41#issuecomment-411298426 |
I'm closing this. It contains personal attacks on contributors to the PHP project which is never acceptable. Plus the original author states: "Not the best issue to start ;) From my point of view, this issue can be closed." |
Hello ;
I've a service factory like this:
Here, if an error occurs, a PDOException is throw. The problem is that the underlying catch statement from the service manager don't handle PDOException code and thus, the following fatal error is raised:
Note: Here the wrong query SET NAMESS is intentional.
Originally posted by @nuxwin at zendframework/zend-servicemanager#41
The text was updated successfully, but these errors were encountered: