@@ -1641,7 +1641,7 @@ with args@Arguments {
16411641 -- @
16421642 let connState' = OutboundUniState connId connThread handle
16431643 writeTVar connVar connState'
1644- return (Just $ mkTransition connState connState')
1644+ return (Right $ mkTransition connState connState')
16451645 Duplex -> do
16461646 -- @
16471647 -- Negotiated^{Duplex}_{Outbound}
@@ -1660,7 +1660,7 @@ with args@Arguments {
16601660 -- `includeInboundConnectionImpl`
16611661 _otherwise -> return ()
16621662
1663- return (Just $ mkTransition connState connState')
1663+ return (Right $ mkTransition connState connState')
16641664
16651665 -- @
16661666 -- SelfConn'^{-1}
@@ -1670,7 +1670,7 @@ with args@Arguments {
16701670 InboundIdleState connId' connThread' handle' Unidirectional -> do
16711671 let connState' = OutboundUniState connId' connThread' handle'
16721672 writeTVar connVar connState'
1673- return (Just $ mkTransition connState connState')
1673+ return (Right $ mkTransition connState connState')
16741674
16751675 -- @
16761676 -- SelfConn'^{-1}
@@ -1680,19 +1680,19 @@ with args@Arguments {
16801680 InboundIdleState connId' connThread' handle' Duplex -> do
16811681 let connState' = OutboundDupState connId' connThread' handle' Ticking
16821682 writeTVar connVar connState'
1683- return (Just $ mkTransition connState connState')
1683+ return (Right $ mkTransition connState connState')
16841684
1685- TerminatedState _ ->
1686- return Nothing
1685+ TerminatedState err ->
1686+ return $ Left err
16871687 _ ->
16881688 let st = State. abstractState (Known connState) in
16891689 throwSTM (withCallStack (ForbiddenOperation peerAddr st))
16901690 traverse_ (traceWith trTracer . TransitionTrace connStateId)
16911691 mbTransition
16921692 traceCounters stateVar
16931693 return $ case mbTransition of
1694- Just _ -> Connected connId dataFlow handle
1695- Nothing -> Disconnected connId Nothing
1694+ Right _ -> Connected connId dataFlow handle
1695+ Left err -> Disconnected connId err
16961696
16971697 Right (There connId) -> do
16981698 -- We can only enter the 'There' case if there is an inbound
0 commit comments