@@ -167,7 +167,11 @@ runJavaScript sendBatch entryPoint = do
167167 sendBatch batch
168168 atomically (readTChan recvChan) >>= \case
169169 Success results -> zipWithM_ putMVar resultMVars results
170− Failure results exception -> zipWithM_ putMVar resultMVars $ results <> repeat (ThrowJSValue exception)
170+ Failure results exception -> do
171+ -- The exception will only be rethrown in Haskell if/when one of the
172+ -- missing results (if any) is evaluated.
173+ putStrLn "A JavaScript exception was thrown! (may not reach Haskell code)"
174+ zipWithM_ putMVar resultMVars $ results <> repeat (ThrowJSValue exception)
171175 _ -> error "Unexpected jsaddle results"
172176 return (processResults, runReaderT (unJSM entryPoint) ctx)
173177 where