Remove DBErrorDetailsProvider#543
Merged
psainics merged 1 commit intodata-integrations:developfrom Jan 29, 2025
Merged
Conversation
5f51a10 to
1e1c536
Compare
b89815d to
c23a385
Compare
| } | ||
| } catch (SQLException e) { | ||
| // wrap exception to ensure SQLException-child instances not exposed to contexts w/o jdbc driver in classpath | ||
| String errorMessage = e.getMessage(); |
Contributor
There was a problem hiding this comment.
errorReason should also contain errorCode & sqlState
Contributor
Author
There was a problem hiding this comment.
That's in errorMessageWithDetails, we are not doing the same at other places.
Contributor
There was a problem hiding this comment.
In other plugins, we are adding errorCode information in errorReason as well, we should do the same in db-plugins as well for consistency.
Contributor
There was a problem hiding this comment.
The format can be something like:
"SQL Exception occurred: [Message='%s', SQLState='%s', ErrorCode='%s']. For more details, see %s"
Contributor
Author
There was a problem hiding this comment.
Updated error message !
Will be raising a PR for same change in hydrator-plugins !
Contributor
itsankit-google
left a comment
There was a problem hiding this comment.
please also do a similar test for Postgres as well.
Contributor
Author
Added Postgres test ! |
c23a385 to
8d7e9cd
Compare
itsankit-google
approved these changes
Jan 29, 2025
This was referenced Jan 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove DBErrorDetailsProvider
Description
Code change
DBErrorDetailsProvider.javaAbstractDBSink.javaAbstractDBSource.javaMysqlErrorDetailsProvider.javaPostgresErrorDetailsProvider.javaTests [ MySql ]
[ { "stageName": "MySQL2", "errorCategory": "Plugin-'DB Integrity Constraint Violation'-'MySQL2'", "errorReason": "Duplicate entry '1' for key 'PRIMARY'. For more details, see https://dev.mysql.com/doc/mysql-errors/9.0/en/", "errorMessage": "Error occurred in the phase: 'Writing' with sqlState: '23000', errorCode: '1062', errorMessage: Duplicate entry '1' for key 'PRIMARY'", "errorType": "USER", "dependency": "true", "errorCodeType": "SQLSTATE", "errorCode": "23000", "supportedDocumentationUrl": "https://dev.mysql.com/doc/mysql-errors/9.0/en/" } ]Tests [ postgresql ]
[ { "stageName": "PostgreSQL2", "errorCategory": "Plugin-'Postgres Integrity Constraint Violation'-'PostgreSQL2'", "errorReason": "Batch entry 0 INSERT INTO \"user2\" (\"id\",\"name\",\"age\",\"gender\") VALUES (1,'Alice',25,'female') was aborted: ERROR: duplicate key value violates unique constraint \"user2_pkey\"\n Detail: Key (id)=(1) already exists. Call getNextException to see other errors in the batch. For more details, see https://www.postgresql.org/docs/current/errcodes-appendix.html", "errorMessage": "Error occurred in the phase: 'Writing' with sqlState: '23505', errorCode: '0', errorMessage: Batch entry 0 INSERT INTO \"user2\" (\"id\",\"name\",\"age\",\"gender\") VALUES (1,'Alice',25,'female') was aborted: ERROR: duplicate key value violates unique constraint \"user2_pkey\"\n Detail: Key (id)=(1) already exists. Call getNextException to see other errors in the batch.", "errorType": "USER", "dependency": "true", "errorCodeType": "SQLSTATE", "errorCode": "23505", "supportedDocumentationUrl": "https://www.postgresql.org/docs/current/errcodes-appendix.html" } ]