Skip to content

Commit

Permalink
More obvious way of returning dumper init erorrs
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarvardt committed Apr 2, 2020
1 parent 527b44c commit 0216803
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/dumper/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ func NewDumper(opts ConnOpts, rdr reader.Reader) (dumper Dumper, err error) {
return false
})

if dumper == nil && err == nil {
err = fmt.Errorf("no supported driver found for dumper DSN %q", opts.DSN)
if err != nil {
return nil, wErrors.Wrapf(err, "could not create dumper for DSN: %q", opts.DSN)
}

err = wErrors.Wrapf(err, "could not create dumper for DSN: %q", opts.DSN)
if dumper == nil {
return nil, fmt.Errorf("no supported driver found for dumper DSN %q", opts.DSN)
}

return
}

0 comments on commit 0216803

Please sign in to comment.