diff --git a/scan.go b/scan.go index c78077b..58bbce5 100644 --- a/scan.go +++ b/scan.go @@ -4,6 +4,7 @@ import ( "database/sql" "encoding/json" "errors" + "fmt" "reflect" ) @@ -138,7 +139,7 @@ func sStructSlice(rows *sql.Rows, dest any) (result RowScan) { if data := *scanArgs[i].(*[]uint8); len(data) > 0 { v := rv.Addr().Interface() if err := json.Unmarshal(data, &v); err != nil { - panic(err) + panic(fmt.Sprintf("[%s:%q] => %s", rv.Kind(), data, err)) } } } @@ -212,7 +213,7 @@ func sStruct(rows *sql.Rows, dest any) (result RowScan) { if data := *scanArgs[i].(*[]uint8); len(data) > 0 { v := rv.Addr().Interface() if err := json.Unmarshal(data, &v); err != nil { - panic(err) + panic(fmt.Sprintf("[%s:%q] => %s", rv.Kind(), data, err)) } } }