aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bangs.json1
-rw-r--r--src/BangState.hs5
2 files changed, 3 insertions, 3 deletions
diff --git a/bangs.json b/bangs.json
deleted file mode 100644
index 9e26dfe..0000000
--- a/bangs.json
+++ /dev/null
@@ -1 +0,0 @@
-{} \ No newline at end of file
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