add a check for unknown UUID when logging
This commit is contained in:
parent
2eb6210525
commit
500ddd7f4b
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue