Skip to content

Commit

Permalink
Don't swallow errors in listPoolLifeCycleData.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Sep 7, 2020
1 parent 83de0c4 commit cea2818
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/core/src/Cardano/Pool/DB/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,12 @@ newDBLayer trace fp timeInterpreter = do
rights . fmap safeCast <$> rawSql query parameters

listPoolLifeCycleData epochNo =
rights . fmap parseRow <$> rawSql query parameters
fmap (assertSuccess . parseRow) <$> rawSql query parameters
where
assertSuccess = flip either id $ \e -> error $ mconcat
[ "Unexpected failure to parse pool lifecycle data: "
, show e
]
query = T.unwords
[ "SELECT *"
, "FROM active_pool_lifecycle_data"
Expand Down

0 comments on commit cea2818

Please sign in to comment.