Closed ocramz closed 9 months ago
it works omg it w o r k s I'm so happeeeehhh
Noice
@ocramz Is it intentional that you merged this PR? Before merging this PR, At very least I expected you to
@fumieval yes sorry for not waiting but I triple checked everything, added more tests around the new exception mechanism and made a Hackage release. These were long-due changes anyway..
scotty-0.20
:ActionT
using the "ReaderT pattern" : https://www.fpcomplete.com/blog/readert-design-pattern/StatusError
type can be thrown and caught, butNext
,Finish
andRedirect
cannot be caught by the user. ForStatusError
and any user-defined (or imported) exception types, one can either catch exceptions inline withrescue
or globally for the whole app withdefaultHandler
.Breaking changes:
unliftio
as a dependency, and base exception handling oncatch
.rescue
changes signature to use properException
types rather than strings.text
,html
etc.) have now a MonadIO constraint on the base monad rather than Monad because the Response is in a TVar insideActionEnv
.rescue
has a MonadUnliftIO constraint. The Alternative instance of ActionT is also based on MonadUnliftIO because<|>
is implemented in terms ofcatch
.Closes #310 , closes #309 in passing
closes #110 , closes #153