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

Removed errorCode() and errorInfo() methods from Connection and Statement APIs #3507

Merged
merged 1 commit into from
Apr 6, 2019

Conversation

morozov
Copy link
Member

@morozov morozov commented Apr 6, 2019

Q A
Type improvement
BC Break yes

The reasons or removal are:

  1. It's an archaism inherited from PDO and relevant only for the procedural type of API (do_stuff(), get_last_error()) which was only relevant for the PDO::ERRMODE_WARNING mode.
  2. The current implementation is not portable: for DB2, the meaning of the code is SQLState, for MySQL it's the driver error code. Unlike others drivers where the error info is a tuple of error code and message, sqlsrv returns a list of such tuples.
  3. This API is not covered with integration tests which proves #‌2.
  4. Tuples are not supported natively by PHP which makes it harder to analyze these methods statically.

@Ocramius Ocramius self-assigned this Apr 6, 2019
@Ocramius Ocramius added this to the 3.0.0 milestone Apr 6, 2019
@Ocramius Ocramius merged commit a96e4b1 into doctrine:develop Apr 6, 2019
@@ -1,5 +1,9 @@
# Upgrade to 3.0

## BC BREAK `::errorCode()` and `::errorInfo()` removed from `Connection` and `Statement` APIs

The error information is available in `DriverException` trown in case of an error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"thrown" 😛

Copy link
Member Author

@morozov morozov Apr 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a spellchecker on CI? 🤔

@morozov morozov deleted the error-code-info branch April 6, 2019 06:19
morozov pushed a commit that referenced this pull request Apr 16, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request May 6, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request May 23, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit to morozov/dbal that referenced this pull request May 31, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit to morozov/dbal that referenced this pull request May 31, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request Jun 13, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request Jun 27, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request Jun 27, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request Jun 27, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit to morozov/dbal that referenced this pull request Aug 26, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit to morozov/dbal that referenced this pull request Aug 27, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
morozov pushed a commit that referenced this pull request Nov 2, 2019
Removed errorCode() and errorInfo() methods from Connection and Statement APIs
@morozov morozov removed this from the 4.0.0 milestone Nov 17, 2020
@morozov morozov added this to the 3.0.0 milestone Nov 17, 2020
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 7, 2021
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 7, 2021
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 11, 2021
beberlei added a commit to beberlei/dbal that referenced this pull request Mar 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 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.

3 participants