aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index ca71b29..e5b33d4 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -26,6 +26,7 @@ import Control.Monad.IO.Class
import Control.Monad.Logger
import System.Directory
import Control.Monad.Extra
+import Control.Exception
import F2Md.Types
import F2Md.Import
import F2Md.Export
@@ -41,7 +42,11 @@ main = do
mapM_ (createDirectoryIfMissing True)
[root </> "new", root </> "cur", root </> "tmp"]
let dbPath = fromMaybe (oDbPath options) mbDbPath
- mapM_ (runStdoutLoggingT . processFeed root dbPath) feeds
+ mapM_ (\feed ->
+ catch (runStdoutLoggingT $ processFeed root dbPath feed)
+ (\e -> runStderrLoggingT $ logErrorN $
+ (T.pack $ show (e :: SomeException)) <> "\n"))
+ feeds
where opts = info (progParser <**> helper)
(fullDesc <> progDesc "f2md feeds to maildir"
<> header "f2md - a utility to pull new items \