Skip to content
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

Create a custom exception list and add to tests #1

Closed
mmoreram opened this issue Feb 8, 2020 · 7 comments
Closed

Create a custom exception list and add to tests #1

mmoreram opened this issue Feb 8, 2020 · 7 comments

Comments

@mmoreram
Copy link
Member

mmoreram commented Feb 8, 2020

No description provided.

@seregazhuk
Copy link
Member

It looks like currently only Postgres driver exception is not handled by the deferred object.

Here instead of null we can add a handler and reject a deferred with an exception. For all other drivers, they just forward their exceptions up.

I'll try to fix Postgres driver and add a test for exception handling.

@mmoreram
Copy link
Member Author

@seregazhuk a DBAL should always work with custom exceptions, instead of working with specific ones.

That means that if mysql adapter throws an exception for Timeout, we should catch it and make a conversion per each adapter. AT the end, we should be able to work 100% with custom DBAL namespaces in our code, being able to switch between adapters :)

Could we make that list here?
Then we can cover with tests, and start making adaptations + making all tests green.

@mmoreram
Copy link
Member Author

@seregazhuk started here - #3

@seregazhuk
Copy link
Member

@mmoreram Aren't you reinventing the wheel here? Doctrine DBAL already has this logic for mapping driver error cases into exceptions. For example, your case with TableNotFound and MySQL can be found here.

I think that we should somehow reuse doctrine logic, instead of rewriting everything from scratch.

@mmoreram
Copy link
Member Author

mmoreram commented Feb 10, 2020

@seregazhuk LOL.

Good to hear that.
It seems that we will be able to reuse much more code that I expected :D:D:D

@seregazhuk
Copy link
Member

Closing because already implemented in Doctrine.

@mmoreram
Copy link
Member Author

Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants