Chore: Enable errorlint linter (#29227)
* Enable errorlint linter * Handle wrapped errors Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
co-authored by
Emil Tullstedt
parent
993adb72e0
commit
9593d57914
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/gchaincl/sqlhooks"
|
||||
@@ -87,7 +88,7 @@ func (h *databaseQueryWrapper) After(ctx context.Context, query string, args ...
|
||||
func (h *databaseQueryWrapper) OnError(ctx context.Context, err error, query string, args ...interface{}) error {
|
||||
status := "error"
|
||||
// https://golang.org/pkg/database/sql/driver/#ErrSkip
|
||||
if err == nil || err == driver.ErrSkip {
|
||||
if err == nil || errors.Is(err, driver.ErrSkip) {
|
||||
status = "success"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user