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

Add exception code to logAndThrowException #719

Merged
merged 6 commits into from
Nov 10, 2018

Conversation

smgallo
Copy link
Contributor

@smgallo smgallo commented Nov 2, 2018

Note: This is for 8.1

Description

Loggable:logAndThrowException() includes a message but does not include an error code. If an exception was provided in the options list, use the error code from that exception. Note that PDOException uses a string exception code (typically a five characters alphanumeric identifier defined in the ANSI SQL standard) while Exception uses an int. For these cases, use the driver specific error code instead so that we can propagate the error code with the newly thrown Exception.

For a mapping of MySQL specific error codes to ANSI-SQL identifiers see https://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html

Motivation and Context

@eiffel777 can utilize this information to decide whether or not cloud data is present and should be ingested/aggregated.

Tests performed

Manually ran tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@smgallo
Copy link
Contributor Author

smgallo commented Nov 3, 2018

@chakrabortyr This PR includes tests to ensure logAndThrowException() is behaving properly.

@smgallo smgallo added this to the 8.1.0 milestone Nov 3, 2018
@smgallo smgallo added enhancement Enhancement of the functionality of an existing feature Category:ETL Extract Transform Load labels Nov 3, 2018
Copy link
Contributor

@chakrabortyr chakrabortyr left a comment

Choose a reason for hiding this comment

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

No other edges spring to mind, LGTM

@smgallo smgallo changed the base branch from xdmod8.0 to xdmod8.1 November 9, 2018 15:31
@smgallo smgallo merged commit 258d820 into ubccr:xdmod8.1 Nov 10, 2018
@smgallo smgallo deleted the add-exception-code branch November 10, 2018 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:ETL Extract Transform Load enhancement Enhancement of the functionality of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants