Copyright | (c) 2020-2021 berberman |
---|---|
License | MIT |
Maintainer | berberman <berberman@yandex.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Exceptions used in this project.
Synopsis
- type WithMyErr = Error MyException
- data MyException
- printHandledIOException :: IO () -> IO ()
- printAppResult :: IO (Either MyException ()) -> IO ()
- tryMaybe :: Member WithMyErr r => Sem r a -> Sem r (Maybe a)
- interceptHttpException :: Members [WithMyErr, Embed IO] r => IO a -> Sem r a
Documentation
type WithMyErr = Error MyException Source #
Error effect of MyException
data MyException Source #
Custom exception used in this project
Instances
Show MyException Source # | |
Defined in Distribution.ArchHs.Exception showsPrec :: Int -> MyException -> ShowS # show :: MyException -> String # showList :: [MyException] -> ShowS # |
printHandledIOException :: IO () -> IO () Source #
Catch IOException
and print it.
printAppResult :: IO (Either MyException ()) -> IO () Source #
Print the result of errorToIOFinal
.
tryMaybe :: Member WithMyErr r => Sem r a -> Sem r (Maybe a) Source #
Like try
but discard the concrete exception.
interceptHttpException :: Members [WithMyErr, Embed IO] r => IO a -> Sem r a Source #
Catch the HttpException
thrown in IO
monad, then re-throw it with NetworkException
.