@@ -161,15 +161,15 @@ withTransactionModeRetry mode shouldRetry conn act =
161161 commit conn
162162 return a
163163 where
164− retryLoop :: IO (Either E.SomeException a) -> IO a
164+ retryLoop :: IO (Either SqlError a) -> IO a
165165 retryLoop act' = do
166166 beginMode mode conn
167167 r <- act'
168168 case r of
169169 Left e ->
170− case fmap shouldRetry (E.fromException e) of
171− Just True -> retryLoop act'
172− _ -> E.throwIO e
170+ case shouldRetry e of
171+ True -> retryLoop act'
172+ False -> E.throwIO e
173173 Right a ->
174174 return a
175175