on master help sign in
Merge pull request #69 from obsidiansystems/eac-backend-error-msg

Show error message when backend crashes

commit39acdd5bcdb6467a612498e6430f26154c47bd9a authorRyan Trinkle <ryan.trinkle@gmail.com> dateThu 7 Jun 2018, 12:28 (8 years ago) parent6c38599d91db1e
2 files changed+4−4
default.nix+3−3 lib/run/src/Obelisk/Run.hs+1−1
default.nix+3−3
@@ -273,10 +273,10 @@ rec {
273273 };
274274 };
275275 in mkProject (projectDefinition args));
276+ exe = serverExe (projectOut "x86_64-linux").ghc.backend (projectOut system).ghcjs.frontend assets.symlinked configPath;
276277 in projectOut system // {
277− server = { hostName }:
278− let exe = serverExe (projectOut "x86_64-linux").ghc.backend (projectOut system).ghcjs.frontend assets.symlinked configPath;
279− in server exe hostName;
278+ inherit exe;
279+ server = { hostName }: server exe hostName;
280280 obelisk = import (base + "/.obelisk/impl") {};
281281 };
282282 haskellPackageSets = {
lib/run/src/Obelisk/Run.hs+1−1
@@ -41,7 +41,7 @@ run :: Int -- ^ Port to run the backend
4141 -> (StaticWidget () (), Widget () ()) -- ^ Frontend widget (head, body)
4242 -> IO ()
4343run port backend frontend = do
44− let handleBackendErr (_ :: IOException) = hPutStrLn stderr "backend stopped; make a change to your code to reload"
44+ let handleBackendErr (e :: IOException) = hPutStrLn stderr $ "backend stopped; make a change to your code to reload - error " <> show e
4545 backendTid <- forkIO $ handle handleBackendErr $ withArgs ["--quiet", "--port", show port] backend
4646 putStrLn $ "Backend running on port " <> show port
4747 let conf = defRunConfig { _runConfig_redirectPort = port }