diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,8 @@
 Changelog for ghcid (* = breaking change)
 
+0.8, released 2019-12-04
+*   Add an extra field to GhciError
+    #288, include the last line of stderr in shutdown messages
 0.7.7, released 2019-11-24
     #287, only lint reloaded files
 0.7.6, released 2019-10-13
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # ghcid [![Hackage version](https://img.shields.io/hackage/v/ghcid.svg?label=Hackage)](https://hackage.haskell.org/package/ghcid) [![Stackage version](https://www.stackage.org/package/ghcid/badge/nightly?label=Stackage)](https://www.stackage.org/package/ghcid) [![Linux build status](https://img.shields.io/travis/ndmitchell/ghcid/master.svg?label=Linux%20build)](https://travis-ci.org/ndmitchell/ghcid) [![Windows build status](https://img.shields.io/appveyor/ci/ndmitchell/ghcid/master.svg?label=Windows%20build)](https://ci.appveyor.com/project/ndmitchell/ghcid)
 
-Either "GHCi as a daemon" or "GHC + a bit of an IDE". To a first approximation, it opens `ghci` and runs `:reload` whenever your source code changes, formatting the output to fit a fixed height console. Unlike other Haskell development tools, `ghcid` is intended to be _incredibly simple_. In particular, it doesn't integrate with any editors, doesn't depend on GHC the library and doesn't start web servers.
+Either "GHCi as a daemon" or "GHC + a bit of an IDE". To a first approximation, it opens `ghci` and runs `:reload` whenever your source code changes, formatting the output to fit a fixed height console. Unlike other Haskell development tools, `ghcid` is intended to be _incredibly simple_. In particular, it doesn't integrate with any editors, doesn't provide access to the `ghci` it starts, doesn't depend on GHC the library and doesn't start web servers.
 
 _Acknowledgements:_ This project incorporates significant work from [JPMoresmau](https://github.com/JPMoresmau), who is listed as a co-author.
 
diff --git a/ghcid.cabal b/ghcid.cabal
--- a/ghcid.cabal
+++ b/ghcid.cabal
@@ -1,7 +1,7 @@
 cabal-version:      >= 1.18
 build-type:         Simple
 name:               ghcid
-version:            0.7.7
+version:            0.8
 license:            BSD3
 license-file:       LICENSE
 category:           Development
diff --git a/src/Ghcid.hs b/src/Ghcid.hs
--- a/src/Ghcid.hs
+++ b/src/Ghcid.hs
@@ -181,10 +181,19 @@
     ,termWrap :: WordWrap
     }
 
+-- | On the 'UnexpectedExit' exception exit with a nice error message.
+handleErrors :: IO () -> IO ()
+handleErrors = handle $ \(UnexpectedExit cmd _ mmsg) -> do
+    putStr $ "Command \"" ++ cmd ++ "\" exited unexpectedly"
+    putStrLn $ case mmsg of
+        Just msg -> " with error message: " ++ msg
+        Nothing -> ""
+    exitFailure
+
 -- | Like 'main', but run with a fake terminal for testing
 mainWithTerminal :: IO TermSize -> ([String] -> IO ()) -> IO ()
 mainWithTerminal termSize termOutput =
-    handle (\(UnexpectedExit cmd _) -> do putStrLn $ "Command \"" ++ cmd ++ "\" exited unexpectedly"; exitFailure) $
+    handleErrors $
         forever $ withWindowIcon $ withSession $ \session -> do
             setVerbosity Normal -- undo any --verbose flags
 
diff --git a/src/Language/Haskell/Ghcid.hs b/src/Language/Haskell/Ghcid.hs
--- a/src/Language/Haskell/Ghcid.hs
+++ b/src/Language/Haskell/Ghcid.hs
@@ -96,19 +96,20 @@
                 syncReplay
 
         -- Consume from a stream until EOF (return Nothing) or some predicate returns Just
-        let consume :: Stream -> (String -> IO (Maybe a)) -> IO (Maybe a)
+        let consume :: Stream -> (String -> IO (Maybe a)) -> IO (Either (Maybe String) a)
             consume name finish = do
                 let h = if name == Stdout then out else err
-                fix $ \rec -> do
+                flip fix Nothing $ \rec oldMsg -> do
                     el <- tryBool isEOFError $ hGetLine h
                     case el of
-                        Left _ -> return Nothing
+                        Left _ -> return $ Left oldMsg
                         Right l -> do
                             whenLoud $ outStrLn $ "%" ++ upper (show name) ++ ": " ++ l
-                            res <- finish $ removePrefix l
+                            let msg = removePrefix l
+                            res <- finish msg
                             case res of
-                                Nothing -> rec
-                                Just a -> return $ Just a
+                                Nothing -> rec $ Just msg
+                                Just a -> return $ Right a
 
         let consume2 :: String -> (Stream -> String -> IO (Maybe a)) -> IO (a,a)
             consume2 msg finish = do
@@ -118,11 +119,13 @@
                 res2 <- onceFork $ consume Stderr (finish Stderr)
                 res1 <- res1
                 res2 <- res2
-                case liftM2 (,) res1 res2 of
-                    Nothing -> case cmdspec process of
-                        ShellCommand cmd -> throwIO $ UnexpectedExit cmd msg
-                        RawCommand exe args -> throwIO $ UnexpectedExit (unwords (exe:args)) msg
-                    Just v -> return v
+                let raise msg err = throwIO $ case cmdspec process of
+                        ShellCommand cmd -> UnexpectedExit cmd msg err
+                        RawCommand exe args -> UnexpectedExit (unwords (exe:args)) msg err
+                case (res1, res2) of
+                    (Right v1, Right v2) -> return (v1, v2)
+                    (_, Left err) -> raise msg err
+                    (_, Right _) -> raise msg Nothing
 
         -- held while interrupting, and briefly held when starting an exec
         -- ensures exec values queue up behind an ongoing interrupt and no two interrupts run at once
diff --git a/src/Language/Haskell/Ghcid/Types.hs b/src/Language/Haskell/Ghcid/Types.hs
--- a/src/Language/Haskell/Ghcid/Types.hs
+++ b/src/Language/Haskell/Ghcid/Types.hs
@@ -12,8 +12,12 @@
 import Control.Exception.Base (Exception)
 
 -- | GHCi shut down
-data GhciError = UnexpectedExit String String
-    deriving (Show,Eq,Ord,Typeable,Data)
+data GhciError = UnexpectedExit
+    {ghciErrorCmd :: String
+    ,ghciErrorMsg :: String
+    ,ghciErrorLastStdErr :: Maybe String
+    }
+    deriving (Show, Eq, Ord, Typeable, Data)
 
 -- | Make GhciError an exception
 instance Exception GhciError
