Fix an improperly ignored error in SQLite

This looks like a case of boilerplate error handling making it
too easy to miss a legitimately ignored error, which is annoying.
In a more featureful language most of the SQL code here could be
macros (at the very least, Rust would have forced us to handle
all error cases, not just the one seen here).

Found while looking through the Libpod DB code, no actual bug I
can think of associated with this.

Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
Matt Heon 2024-08-27 10:42:58 -04:00
parent f0f148ead4
commit 6e027c0e37
1 changed files with 1 additions and 0 deletions

View File

@ -2157,6 +2157,7 @@ func (s *SQLiteState) Volume(name string) (*Volume, error) {
if errors.Is(err, sql.ErrNoRows) {
return nil, define.ErrNoSuchVolume
}
return nil, fmt.Errorf("querying volume %s: %w", name, err)
}
vol := new(Volume)