@@ -296,14 +296,14 @@ spawn nid proc = do
296296 `seqCP` proc
297297 mPid <- receiveWait
298298 [ matchIf (\(DidSpawn ref _) -> ref == sRef)
299− (\(DidSpawn _ pid) -> return $ Just pid)
299+ (\(DidSpawn _ pid) -> return $ Right pid)
300300 , matchIf (\(NodeMonitorNotification ref _ _) -> ref == mRef)
301− (\_ -> return Nothing)
301+ (\(NodeMonitorNotification _ _ err) -> return $ Left err)
302302 ]
303303 unmonitor mRef
304304 case mPid of
305− Nothing -> fail "spawn: remote node failed"
306− Just pid -> send pid () >> return pid
305+ Left err -> fail $ "spawn: remote node failed: " ++ show err
306+ Right pid -> send pid () >> return pid
307307
308308-- | Spawn a process and link to it
309309--