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

c14h: return error when starting a transaction #111

Closed
wants to merge 0 commits into from

Conversation

Merovius
Copy link
Contributor

I believe we are currently being bitten by #8 quite regularly. This is
exacerbated by not checking for an error by tx.Begin() (that's on me, I
presume), so we panic on a nil-pointer, instead of getting an error
message. Unfortunately, I still can't see a super clear-cut way to check
whether an error is caused by this issue and it shouldn't even be an
issue, as *sql.DB is a connection pool - so it should just handle this
transparently, IMO. But at least if we know the error message, we might
get a hint on how to handle that correctly.

c14h/sql.go Outdated

tx, err := db.Begin()
if err != nil {
reutrn err
Copy link
Member

Choose a reason for hiding this comment

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

There is a typo here, most likely the cause for the CI-failure, other than that, it looks ready to merge for me.

@Merovius
Copy link
Contributor Author

m( You know you should've just gone to bed, when you don't even try to build a change before sending it for review…

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.

3 participants