diff options
author | 2011-01-04 17:03:29 -0400 | |
---|---|---|
committer | 2011-01-04 17:03:29 -0400 | |
commit | 500ddd7f4bf36cdcaa7c0bdf5dae617c36535371 (patch) | |
tree | 658ed73d0138d5b64d58556d0551b6ea766c91cb | |
parent | 2eb621052599f3a112d57480a5e123bb47835644 (diff) |
add a check for unknown UUID when logging
-rw-r--r-- | LocationLog.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/LocationLog.hs b/LocationLog.hs index 6d52f4bdd..e4dad03f5 100644 --- a/LocationLog.hs +++ b/LocationLog.hs @@ -32,6 +32,7 @@ import System.Locale import qualified Data.Map as Map import System.Directory import System.Posix.Process +import Control.Monad (when) import qualified GitRepo as Git import Utility @@ -86,6 +87,8 @@ instance Read LogLine where - and returns the filename of the logfile. -} logChange :: Git.Repo -> Key -> UUID -> LogStatus -> IO FilePath logChange repo key u s = do + when (null u) $ + error $ "bug detected: unknown UUID for " ++ Git.repoDescribe repo line <- logNow s u ls <- readLog logfile writeLog logfile (compactLog $ line:ls) |