pg icon indicating copy to clipboard operation
pg copied to clipboard

AfterQuery Hook evt.Err not set after ErrNoRows error occurs

Open atamano opened this issue 4 years ago • 0 comments

I am trying to catch all pg errors using hooks but I realized that evt.Err is nil when ErrNoRows occurs in the "AfterQuery" method.

func (q queryHook) AfterQuery(ctx context.Context, evt *pg.QueryEvent) error {
    fmt.Println(evt.Err); // <-- always nil
    return nil
}

atamano avatar Dec 03 '20 09:12 atamano