Skip to content

How to check for custom exceptions raised via RAISE? #1339

Answered by abhijit-hota
abhijit-hota asked this question in Q&A
Discussion options

You must be logged in to vote

Use *pgconn.PgError:

var pgErr *pgconn.PgError
if errors.As(err, &pgErr) {
    //pgErr has all the fluff
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by abhijit-hota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant