krdlab / haskell-oidc-client

OpenID Connect 1.0 client (RP) library for Haskell

Home Page:https://hackage.haskell.org/package/oidc-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove use of `throwIO`

ixmatus opened this issue · comments

Thank you for this library! I'm using it for a project at work and it has, so far, worked really well for my use-case.

I am creating this issue ticket to track some usability changes I'm making to your library that I will turn into a PR when it is ready.

The usability issue is the use of asynchronous exceptions. I just discovered that multiple, important functions of this library use throwIO. The library would be easier to use (i.e. it would compose better) if it did not throw asynchronous exceptions. The function's type signature doesn't document the fact that it may throw on the user, asynchronous exceptions are much more painful to handle than synchronous exceptions, and the functions that do throw could easily return synchronous errors instead (e.g. with Either or a custom type).