Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jnewmano
Copy link
Contributor

@jnewmano jnewmano commented Jun 1, 2015

No description provided.

@johto
Copy link
Contributor

johto commented Jun 1, 2015

Can we also add a test case for this?

@jnewmano jnewmano closed this Jun 1, 2015
@jnewmano
Copy link
Contributor Author

jnewmano commented Jun 1, 2015

Ultimately errorf(...) is going to panic anyways, so this PR doesn't really matter. The panic escaping out of pq is causing issues. Is there a reason pq should panic in this case instead of returning an error back to the code that called it? Perhaps there should be a panic recover in rows.Next(), instead of rewriting to pass the error all the way back up.

https://github.com/lib/pq/blob/master/conn.go#L1406

I can submit another PR with the recover in it, if you agree.

@jnewmano jnewmano reopened this Jun 1, 2015
@johto
Copy link
Contributor

johto commented Jun 1, 2015

Does this line not cover it?

@jnewmano
Copy link
Contributor Author

jnewmano commented Jun 1, 2015

It still passes the panic on runtime errors, which in our case was hit by an index out of bounds caused by expect.

https://github.com/lib/pq/blob/master/error.go#L482

@jnewmano jnewmano closed this Jun 1, 2015
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.

2 participants