-
Notifications
You must be signed in to change notification settings - Fork 500
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
base: master
Are you sure you want to change the base?
Conversation
…ssql.Error' is useful for logic behavior.
Codecov Report
@@ Coverage Diff @@
## master #578 +/- ##
=======================================
Coverage 68.72% 68.72%
=======================================
Files 23 23
Lines 5190 5190
=======================================
Hits 3567 3567
Misses 1410 1410
Partials 213 213
Continue to review full report at Codecov.
|
tds.go
Outdated
case doneStruct: | ||
if token.isError() { | ||
return nil, fmt.Errorf("Login error: %s", token.getError()) |
There was a problem hiding this comment.
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(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Can you add tests for this new feature. Also how do you make sure it is backward compatible? |
There was a problem hiding this 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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…ssql.Error' is useful for logic behavior.
fix the issue: #577