Skip to content

Commit

Permalink
Make handleEx total
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Mar 9, 2018
1 parent ed34563 commit cbb69bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/exceptions.hs
Expand Up @@ -33,6 +33,9 @@ handleEx Forbidden = do
handleEx (NotFound i) = do
status status404
html $ fromString $ "<h1>Can't find " ++ show i ++ ".</h1>"
handleEx (StringEx s) = do
status status500
html $ fromString $ "<h1>" ++ s ++ "</h1>"

main :: IO ()
main = scottyT 3000 id $ do -- note, we aren't using any additional transformer layers
Expand Down

0 comments on commit cbb69bf

Please sign in to comment.