jpwilliams/remit

Handling returning success in middleware

jpwilliams opened this issue · 1 comments

Currently, middleware only exits early if an error is thrown. What if I want to return early success?

We could adjust middleware so that:

  • If error is thrown, break chain and send error back
  • If something other than undefined is returned, break chain and send result back
  • If undefined is returned, carry on

Implemented in the new v2 branch.