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

return error of type 'mssql.Error' directly, because the Number in 'm… #578

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sdghchj
Copy link

@sdghchj sdghchj commented May 7, 2020

…ssql.Error' is useful for logic behavior.

fix the issue: #577

@codecov
Copy link

codecov bot commented May 7, 2020

Codecov Report

Merging #578 into master will not change coverage.
The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #578   +/-   ##
=======================================
  Coverage   68.72%   68.72%           
=======================================
  Files          23       23           
  Lines        5190     5190           
=======================================
  Hits         3567     3567           
  Misses       1410     1410           
  Partials      213      213           
Impacted Files Coverage Δ
tds.go 61.03% <50.00%> (ø)

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 06a60b6...efff2aa. Read the comment docs.

tds.go Outdated
case doneStruct:
if token.isError() {
return nil, fmt.Errorf("Login error: %s", token.getError())
Copy link

Choose a reason for hiding this comment

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

we could potentially use wrapping here :
return nil, fmt.Errorf("Login error: %w", token.getError())
that would keep the same current format (add the error string), but also provide the full underlying error when using errors.Is/As(...)

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@denisenkom
Copy link
Owner

Can you add tests for this new feature. Also how do you make sure it is backward compatible?

Copy link
Author

@sdghchj sdghchj left a comment

Choose a reason for hiding this comment

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

@serbrech %w is not supported in go1.10~1.12

tds.go Outdated
case doneStruct:
if token.isError() {
return nil, fmt.Errorf("Login error: %s", token.getError())
Copy link
Author

Choose a reason for hiding this comment

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

fixed

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.

None yet

3 participants