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

[🍒][PLUGIN-1873] Error Management AbstractDBAction #575

Conversation

psainics
Copy link
Contributor

@psainics psainics commented Apr 2, 2025

🍒 [cherrypick]

Commits :

PR:


https://cdap.atlassian.net/browse/PLUGIN-1873

Ref: cdapio/hydrator-plugins#1956

    try {
      executeQuery.run();
    } catch (Exception e) {
      if (e instanceof SQLException) {
        DBErrorDetailsProvider dbe = new DBErrorDetailsProvider();
        throw dbe.getProgramFailureException((SQLException) e, null);
      }
      FailureCollector collector = context.getFailureCollector();
      collector.addFailure("Failed to execute query with message: " + e.getMessage(), null)
          .withStacktrace(e.getStackTrace());
      collector.getOrThrowException();
    }

image

[
  {
    "stageName": "SQL Server Execute",
    "errorCategory": "Plugin-'SQL Server Execute'",
    "errorReason": "SQL Exception occurred: [Message='String or binary data would be truncated in table 'master.dbo.usernames', column 'name'. Truncated value: 'TEST1'.', SQLState='S0001', ErrorCode='2628']. For more details, see https://en.wikipedia.org/wiki/SQLSTATE",
    "errorMessage": "SQL Error occurred, sqlState: 'S0001', errorCode: '2628', errorMessage: SQL Exception occurred: [Message='String or binary data would be truncated in table 'master.dbo.usernames', column 'name'. Truncated value: 'TEST1'.', SQLState='S0001', ErrorCode='2628'].",
    "errorType": "UNKNOWN",
    "dependency": "true",
    "errorCodeType": "SQLSTATE",
    "errorCode": "S0001",
    "supportedDocumentationUrl": "https://en.wikipedia.org/wiki/SQLSTATE"
  }
]

@psainics psainics added the build label Apr 2, 2025
@psainics psainics self-assigned this Apr 2, 2025
@psainics psainics marked this pull request as ready for review April 2, 2025 10:55
@psainics psainics merged commit 4db86b4 into data-integrations:release/1.12 Apr 2, 2025
15 of 17 checks passed
@psainics psainics deleted the cherry-pick/9b368503054ab587861f65909f0c9c71a5793912 branch April 2, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants