Use errors package all over the project
In general: errors.New("thing") -> errors.New fmt.Errorf("thing %s", arg) -> errors.Errorf fmt.Errorf("thing %v", err) -> errors.Wrap fmt.Errorf("thing %s %v", arg, err) -> errors.Wrapf
This commit is contained in:
parent
39eebe7a91
commit
5360d3094e
15 changed files with 55 additions and 53 deletions
bdb/drivers
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
// Side-effect import sql driver
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/vattle/sqlboiler/bdb"
|
||||
)
|
||||
|
||||
|
@ -139,7 +140,7 @@ func (p *PostgresDriver) Columns(tableName string) ([]bdb.Column, error) {
|
|||
var unique bool
|
||||
var defaultPtr *string
|
||||
if err := rows.Scan(&colName, &colType, &defaultPtr, &nullable, &unique); err != nil {
|
||||
return nil, fmt.Errorf("unable to scan for table %s: %s", tableName, err)
|
||||
return nil, errors.Wrapf(err, "unable to scan for table %s", tableName)
|
||||
}
|
||||
|
||||
if defaultPtr == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue