Skip to content

Commit d374da2

Browse files
committed
Handle the case for waitSTM
1 parent 91c00c5 commit d374da2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Control/Concurrent/Async/Internal.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,12 @@ poll = atomically . pollSTM
242242
waitSTM :: Async a -> STM a
243243
waitSTM a = do
244244
r <- waitCatchSTM a
245-
either throwSTM return r
245+
either (rethrowSTM) return r
246+
247+
rethrowSTM e =
248+
case fromException e of
249+
Just (e' :: ExceptionWithContext SomeException) -> throwSTM (NoBacktrace e')
250+
Nothing -> throwSTM e
246251

247252
-- | A version of 'waitCatch' that can be used inside an STM transaction.
248253
--

0 commit comments

Comments
 (0)