Clean up
This commit is contained in:
parent
fa15162620
commit
e72e647b5f
3 changed files with 1 additions and 13 deletions
|
|
@ -1,6 +1,4 @@
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Lib
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = someFunc
|
main = putStrLn "Nothing to see here"
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ instance FromJSON Event where
|
||||||
, EventSnapshot <$> parseJSON v
|
, EventSnapshot <$> parseJSON v
|
||||||
]
|
]
|
||||||
|
|
||||||
--TODO: Add more exceptions for other things that can also go wrong (parsing, connection already closed, ...)
|
|
||||||
data ClientException e
|
data ClientException e
|
||||||
= ServerException (Maybe T.Text) (Maybe T.Text)
|
= ServerException (Maybe T.Text) (Maybe T.Text)
|
||||||
-- ^ @'ServerError' error throttled@ is an error sent by the server in
|
-- ^ @'ServerError' error throttled@ is an error sent by the server in
|
||||||
|
|
@ -187,7 +186,6 @@ defaultDetails = ConnectionDetails
|
||||||
, cdPingInterval = 10
|
, cdPingInterval = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
--TODO: Close connection after client finishes running if it hasn't already been closed
|
|
||||||
runClient :: ConnectionDetails -> Client e a -> IO (Either (ClientException e) a)
|
runClient :: ConnectionDetails -> Client e a -> IO (Either (ClientException e) a)
|
||||||
runClient details (Client stack)
|
runClient details (Client stack)
|
||||||
= withSocketsDo
|
= withSocketsDo
|
||||||
|
|
@ -324,8 +322,6 @@ respondingToPing holdingEvent = do
|
||||||
|
|
||||||
{- Exception handling -}
|
{- Exception handling -}
|
||||||
|
|
||||||
--TODO: Add more commands and find more appropriate names
|
|
||||||
|
|
||||||
throw :: e -> Client e a
|
throw :: e -> Client e a
|
||||||
throw = throwRaw . CustomException
|
throw = throwRaw . CustomException
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
module Lib
|
|
||||||
( someFunc
|
|
||||||
) where
|
|
||||||
|
|
||||||
someFunc :: IO ()
|
|
||||||
someFunc = putStrLn "someFunc"
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue