Skip to content

Commit

Permalink
fix(go/adbc/driver/flightsql): should use ctx.Err().Error() (#1769)
Browse files Browse the repository at this point in the history
As pointed out by @zeroshade
[here](#1722 (comment)),
this should be handled by doing `adbc.Error{Msg: ctx.Err(), Code:....}`.
  • Loading branch information
cocoa-xu authored Apr 26, 2024
1 parent 71072e0 commit 59eede4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/adbc/driver/flightsql/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ func checkContext(maybeErr error, ctx context.Context) error {
if maybeErr != nil {
return maybeErr
} else if ctx.Err() == context.Canceled {
return adbc.Error{Msg: "Cancelled by request", Code: adbc.StatusCancelled}
return adbc.Error{Msg: ctx.Err().Error(), Code: adbc.StatusCancelled}
} else if ctx.Err() == context.DeadlineExceeded {
return adbc.Error{Msg: "Deadline exceeded", Code: adbc.StatusTimeout}
return adbc.Error{Msg: ctx.Err().Error(), Code: adbc.StatusTimeout}
}
return ctx.Err()
}
Expand Down

0 comments on commit 59eede4

Please sign in to comment.