aboutsummaryrefslogtreecommitdiffstats
path: root/src/Lib.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Lib.hs')
-rw-r--r--src/Lib.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Lib.hs b/src/Lib.hs
index 3b49136..f8745b2 100644
--- a/src/Lib.hs
+++ b/src/Lib.hs
@@ -2,11 +2,6 @@ module Lib
( someFunc
) where
-import Control.Exception (catch)
--- import System.Environment
--- import System.IO
--- import System.IO.Error
-
import Database.SQLite.Simple
import Message
@@ -22,8 +17,7 @@ someFunc = do
Just plugin = matchPlugin message
dbConn <- open "db/sorbot_development.sqlite3"
response <- performPlugin plugin message dbConn
- putStrLn response `catch` handleError
+ case response of
+ Left e -> putStrLn e
+ Right r -> putStrLn r
close dbConn
-
-handleError :: IOError -> IO ()
-handleError err = putStrLn $ show err