aboutsummaryrefslogtreecommitdiffstats
path: root/src/Reaktor/Plugins/Register.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-01-27 18:52:25 +0100
committertv <tv@krebsco.de>2019-01-27 18:52:25 +0100
commit4d85ce5584c5bc69b402b7d3b94c623f37ea69f5 (patch)
treeeb1b5b01b521b7d8c695384f3e731413a0f5689a /src/Reaktor/Plugins/Register.hs
parent32ddebc0309a73c50e0f1974b4f9435fce3f86c9 (diff)
src: replace all undefined with typeMismatch
Diffstat (limited to 'src/Reaktor/Plugins/Register.hs')
-rw-r--r--src/Reaktor/Plugins/Register.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Reaktor/Plugins/Register.hs b/src/Reaktor/Plugins/Register.hs
index 979e4ba..dcd130e 100644
--- a/src/Reaktor/Plugins/Register.hs
+++ b/src/Reaktor/Plugins/Register.hs
@@ -6,6 +6,7 @@ module Reaktor.Plugins.Register where
import Blessings
import Data.Aeson
+import Data.Aeson.Types (typeMismatch)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Prelude.Extended
@@ -23,7 +24,7 @@ instance FromJSON ConfigNickServ where
ConfigNickServ
<$> v .: "passFile"
<*> v .:? "prefix" .!= "NickServ!NickServ@services."
- _ -> undefined
+ invalid -> typeMismatch "ConfigNickServ" invalid
data Config = Config
{ cNick :: Maybe Text
@@ -43,7 +44,7 @@ instance FromJSON Config where
cChannels <- v .:? "channels" .!= []
cNickServ <- v .:? "NickServ" .!= cNickServ def
pure Config{..}
- _ -> undefined
+ invalid -> typeMismatch "Config" invalid
new :: Config -> Actions -> IO (Message -> IO ())
new Config{..} Actions{..} = do