Re: [go-nuts] jackc/pgx: error handling

2021-10-18 Thread Larry Rosenman
I had a misunderstanding of what imports needed to be included, and a fundamental misunderstanding of type vs field. I added an import of: github.com/jackc/pgconn and changed the declaration to var pgError *pgconn.PgError and now I'm fine. On Mon, Oct 18, 2021 at 10:24 PM Kurtis Rader wrote:

Re: [go-nuts] jackc/pgx: error handling

2021-10-18 Thread Kurtis Rader
For future readers who stumble upon this thread it would be nice if you explained the problem and solution in more detail. On Mon, Oct 18, 2021 at 8:21 PM Larry Rosenman wrote: > I'm translating an OLD program from lib/pq to pgx, but when I copy the > "Error Handling" code, I get: > ./ambientPro

[go-nuts] jackc/pgx: error handling

2021-10-18 Thread Larry Rosenman
I found my error with some help on a slack channel.  Thanks, though. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To

[go-nuts] jackc/pgx: error handling

2021-10-18 Thread Larry Rosenman
I'm translating an OLD program from lib/pq to pgx, but when I copy the "Error Handling" code, I get: ./ambientProgram.go:164:16: db.PgError undefined (type *pgx.Conn has no field or method PgError) ./ambientProgram.go:210:18: db.PgError undefined (type *pgx.Conn has no field or method PgError)