Skip to content
Snippets Groups Projects
  1. Mar 01, 2022
  2. Feb 28, 2022
    • Jean-Paul Calderone's avatar
      handle the IOException thrown by `payForVoucher` · 2655f77c
      Jean-Paul Calderone authored
      `throwError voucherAlreadyPaid` above is a red herring.  That codepath works
      fine.  It's just unreachable because `payForVoucher` never returns `Left
      AlreadyPaid`.  Instead, it does `throwIO AlreadyPaid`.  Servant doesn't know
      how to do anything good with `AlreadyPaid` (a `PaymentError` rather than a
      `ServerError`) so it logs it and returns a 500 error to the client.
      
      This change adds an exception handler to the `payForVoucher` call that
      transforms all `PaymentError` exceptions into `Left e` values which `charge`
      is already handling.  `throwError` will eventually throw a `ServerError` with
      correct details filled in for these.
      2655f77c
    • Jean-Paul Calderone's avatar
  3. Jan 14, 2022
  4. Jan 13, 2022
  5. Jan 12, 2022
  6. Dec 13, 2021
  7. Oct 07, 2021
  8. Oct 04, 2021
Loading