       | code == StatusOk -> onSuccess
       | otherwise -> onFail code msg
 
-abortIfStatus :: Rpc req resp ()
-abortIfStatus =
+throwIfErrorStatus :: Rpc req resp ()
+throwIfErrorStatus =
   branchOnStatus
     (return ())
     (return ())

joinClientRWOp act = do
  x <- clientRWOp act
  joinReply x


branchOnStatus :: Rpc req resp a
               -> Rpc req resp a

  status <- readMVar statusFromServer
  return (RpcOk status)

clientWrite :: ClientReaderWriter -> B.ByteString -> IO (RpcReply ())
clientWrite crw@(ClientReaderWriter{..}) arg = do
  sendMessageOp <- opSendMessage arg
