diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/BangState.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/BangState.hs b/src/BangState.hs index 582deca..b091532 100644 --- a/src/BangState.hs +++ b/src/BangState.hs @@ -9,6 +9,7 @@ module BangState ( ) where import Codec.Compression.Brotli (compress) +import Control.Applicative ((<|>)) import Control.Concurrent.STM.TChan import Control.Monad (forever) import Data.Aeson @@ -54,8 +55,8 @@ spawnFileSyncThread s = do atomically $ reserialize s loadOwnBangs :: IO Bangs -loadOwnBangs = eitherDecodeFileStrict "bangs.json" >>= \case - Left e -> error e +loadOwnBangs = eitherDecodeFileStrict "bangs.json" <|> return (Left "") >>= \case + Left e -> return mempty Right b -> return b -- also spawns a thread for disk synchronization |