Skip to content

Commit

Permalink
connection-handler: rethrow exceptions using ExceptionInHandler
Browse files Browse the repository at this point in the history
This allows the consensus to use it's error policy to wrap around the
`Ouroboros.Network.Consensus.Node.runWith` to catch all initialisation
errors without interfering with all the exceptions rethrown by the
network layer.
  • Loading branch information
coot committed Sep 22, 2022
1 parent 5d9a5bd commit 59a82be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ makeConnectionHandler muxTracer singMuxMode
throwTo mainThreadId (ExceptionInHandler remoteAddress err)
throwIO err
ShutdownPeer ->
throwIO err
throwIO (ExceptionInHandler remoteAddress err)

outboundConnectionHandler
:: HasInitiator muxMode ~ True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ data Inactive =
deriving (Eq, Show)


-- | Exception which where caught in the connection thread and were re-thrown
-- in the main thread by the 'rethrowPolicy'.
-- | Exception which where caught in the connection thread and were re-thrown in
-- the main thread by the 'rethrowPolicy'.
--
data ExceptionInHandler peerAddr where
ExceptionInHandler :: !peerAddr
Expand Down

0 comments on commit 59a82be

Please sign in to comment.