diff options
Diffstat (limited to 'src/Lib.hs')
-rw-r--r-- | src/Lib.hs | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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 |