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

Improvement | Added new APIs to retrieve SQL Server error information received with SQLServerException #905

Merged
merged 7 commits into from
Dec 17, 2018

Conversation

cheenamalhotra
Copy link
Member

Fixes issue #885

Currently driver does not provide access to detailed information about SQLServerException when error is raised from SQL Server. This PR renames class StreamError to SQLServerError and provides public APIs that can be called to read additional SQL Server error information.

New Public APIs Added:

  • SQLServerException.getSQLServerError()
  • SQLServerError.getErrorMessage()
  • SQLServerError.getErrorNumber()
  • SQLServerError.getErrorState()
  • SQLServerError.getErrorSeverity()
  • SQLServerError.getServerName()
  • SQLServerError.getProcedureName()
  • SQLServerError.getLineNumber()

@codecov-io
Copy link

codecov-io commented Dec 6, 2018

Codecov Report

Merging #905 into dev will decrease coverage by 0.08%.
The diff coverage is 82.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #905      +/-   ##
============================================
- Coverage     48.79%   48.71%   -0.09%     
+ Complexity     2824     2821       -3     
============================================
  Files           118      118              
  Lines         27877    27882       +5     
  Branches       4642     4642              
============================================
- Hits          13602    13582      -20     
- Misses        12086    12103      +17     
- Partials       2189     2197       +8
Flag Coverage Δ Complexity Δ
#JDBC42 48.22% <82.92%> (-0.11%) 2780 <14> (-3)
#JDBC43 48.62% <82.92%> (-0.07%) 2816 <14> (-2)
Impacted Files Coverage Δ Complexity Δ
...m/microsoft/sqlserver/jdbc/KerbAuthentication.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 32.74% <0%> (-0.35%) 256 <0> (-4)
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 59.57% <100%> (ø) 135 <0> (ø) ⬇️
...n/java/com/microsoft/sqlserver/jdbc/tdsparser.java 68.1% <100%> (ø) 0 <0> (ø) ⬇️
.../java/com/microsoft/sqlserver/jdbc/StreamInfo.java 62.5% <100%> (ø) 3 <1> (ø) ⬇️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 55.82% <50%> (-0.17%) 0 <0> (ø)
...a/com/microsoft/sqlserver/jdbc/SQLServerError.java 83.33% <83.33%> (ø) 10 <10> (?)
...m/microsoft/sqlserver/jdbc/SQLServerException.java 77.77% <87.5%> (+0.33%) 32 <3> (+1) ⬆️
...om/microsoft/sqlserver/jdbc/SimpleInputStream.java 52.94% <0%> (-1.48%) 11% <0%> (-1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 45.77% <0%> (-0.66%) 110% <0%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02467eb...03c6f10. Read the comment docs.

@cheenamalhotra cheenamalhotra added this to the 7.1.4 milestone Dec 6, 2018
Copy link
Contributor

@peterbae peterbae left a comment

Choose a reason for hiding this comment

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

Why are we renaming StreamError to SQLServerError? StreamError is a child of the StreamPacket and all the children of StreamPacket have the same naming scheme, and only StreamError is being changed to SQLServerError?

@ulvii
Copy link
Contributor

ulvii commented Dec 12, 2018

Please add tests for the new APIs.

rene-ye
rene-ye previously approved these changes Dec 13, 2018
peterbae
peterbae previously approved these changes Dec 13, 2018
@cheenamalhotra cheenamalhotra dismissed stale reviews from peterbae and rene-ye via f2645ca December 14, 2018 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants