From 6e027c0e37d4deb1427c897b6c6f62a3098df329 Mon Sep 17 00:00:00 2001 From: Matt Heon Date: Tue, 27 Aug 2024 10:42:58 -0400 Subject: [PATCH] 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 --- libpod/sqlite_state.go | 1 + 1 file changed, 1 insertion(+) diff --git a/libpod/sqlite_state.go b/libpod/sqlite_state.go index f51cdc3d7a..1e979727d1 100644 --- a/libpod/sqlite_state.go +++ b/libpod/sqlite_state.go @@ -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)