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

Map error code 1429 to ConnectionException in the AbstractMySQLDriver #2786

Merged
merged 1 commit into from
Jul 21, 2017
Merged

Map error code 1429 to ConnectionException in the AbstractMySQLDriver #2786

merged 1 commit into from
Jul 21, 2017

Conversation

SpacePossum
Copy link
Contributor

1429 Unable to connect to foreign data source

It might be even better to split up the ConnectionException,
making ConnectionException an interface and have one implementation for client-to-server/node exceptions and one for server/node-server/node exception.
However that would be a BC break.
Other way could be to have a new exception for server/node-server/node issue.

Any thoughts?

@Ocramius
Copy link
Member

@SpacePossum how often would you catch those specific exception types?

@SpacePossum
Copy link
Contributor Author

Communication issues within the cluster (like 1492) typically means someone else has to take a look to see what went wrong, than when for example an SyntaxErrorException has been thrown. So I would like to handle those differently.

I can fail back on the error codes of mysql itself, although loose a bit of abstraction from the database.
So if you feel fine graining the (mysql) errors to dedicated exceptions even more is a bit to much, than I can see that point.

@Ocramius
Copy link
Member

I don't have an overview of all exception types here, but a simplistic approach would be OK as a start (this current patch) and a separate issue should be raised if there is a need for a complete inheritance tree overhaul

@Ocramius
Copy link
Member

Meanwhile, merging here, thanks!

@Ocramius Ocramius merged commit 90cf171 into doctrine:master Jul 21, 2017
@Ocramius Ocramius changed the title AbstractMySQLDriver - Map 1429 to ConnectionException Map error code 1429 to ConnectionException in the AbstractMySQLDriver Jul 22, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants