Skip to content

Commit

Permalink
api: improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Jan 5, 2024
1 parent f3b2746 commit 72bf345
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Effectful/Servant.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runWarpServerSettingsContext settings cfg serverEff middleware = do
( \es ->
Warp.runSettings settings (middleware (hoistEff @api es cfg serverEff))
)
error "Warp exited"
error "Oops, the listening server (warp) exited, that should not have happened"

hoistEff ::
forall (api :: Type) (context :: [Type]) (es :: [Effect]).
Expand Down
4 changes: 1 addition & 3 deletions src/Monocle/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ run' ApiConfig {..} aplogger = E.runConcurrent $ runLoggerEffect do
cfg
(rootServer cookieCfg)
middleware
case r of
Left e -> error (show e)
Right e -> error (show e)
error $ "The impossible has happened, the server stopped: " <> show r
where
corsPolicy =
simpleCorsResourcePolicy {corsRequestHeaders = ["content-type"]}
Expand Down

0 comments on commit 72bf345

Please sign in to comment.