Skip to content

Commit

Permalink
Example: Die if registration fails
Browse files Browse the repository at this point in the history
  • Loading branch information
evenbrenden committed Jan 25, 2023
1 parent 6ec7b50 commit 8e5e021
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion example/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Data.Text (Text)
import qualified Data.Text as T
import Data.Void (Void)
import Servant.Client (BaseUrl (BaseUrl), Scheme (Http))
import System.Exit (die)
import Unleash
import Unleash.Client

Expand All @@ -41,7 +42,7 @@ application config = do
registerApplication :: Config -> IO ()
registerApplication config = do
registerClient config >>= \case
Left error -> putStrLn $ "Could not register application (" <> show error <> ")"
Left error -> die $ "Could not register application (" <> show error <> ")"
Right _ -> putStrLn "Application registered"

statePoller :: Config -> IO Void
Expand Down

0 comments on commit 8e5e021

Please sign in to comment.