Skip to content

Instantly share code, notes, and snippets.

@sseveran
Created September 1, 2012 21:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sseveran/3588176 to your computer and use it in GitHub Desktop.
Save sseveran/3588176 to your computer and use it in GitHub Desktop.
Uncaught Exceptions
-- | when no catch frame handles an exception dump core and terminate the process
uncaughtExceptionHandler :: SomeException -> IO ()
{-# NOINLINE uncaughtExceptionHandler #-}
uncaughtExceptionHandler !e = do
syslog Error $ "Unhandled exception: " ++ show e
raiseSignal sigABRT
setDefaultUncaughtExceptionHandler :: IO ()
setDefaultUncaughtExceptionHandler =
setUncaughtExceptionHandler uncaughtExceptionHandler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment