module Main where

import Happstack.Server
import Control.Exception.Extensible as E
import qualified Control.Exception.Lifted as CEL

main :: IO ()
main = simpleHTTP nullConf (fancyErrors impl)

fancyErrors :: ServerPart Response -> ServerPart Response
fancyErrors p =
    p `CEL.catch` (\e -> return (toResponse $ "Here is a fancy error: " ++ show (e :: E.SomeException)))

impl :: ServerPart Response
impl =
    error "Die in a fire!"
