Skip to content

Commit

Permalink
fix: directly return object-not-found errors instead of rewrapping th…
Browse files Browse the repository at this point in the history
…em (#4791)
  • Loading branch information
mapmeld authored Aug 16, 2022
1 parent c0794f5 commit 003ddd8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions master/internal/db/postgres_proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import (
// QueryProto returns the result of the query. Any placeholder parameters are replaced
// with supplied args. Enum values must be the full name of the enum.
func (db *PgDB) QueryProto(queryName string, v interface{}, args ...interface{}) error {
return errors.Wrapf(
db.queryRowsWithParser(db.queries.getOrLoad(queryName), protoParser, v, args...),
"error running query: %v", queryName,
)
err := db.queryRowsWithParser(db.queries.getOrLoad(queryName), protoParser, v, args...)
if err == ErrNotFound {
return err
}
return errors.Wrapf(err, "error running query: %v", queryName)
}

// QueryProtof returns the result of the formated query. Any placeholder parameters are replaced
Expand Down

0 comments on commit 003ddd8

Please sign in to comment.