Railway Oriented Programming
Does this argument hold: This pushes the error handling away from the call site, and that is a bad thing. Being that the caller knows best how to handle the errors, so it should instead of passing them down.(Full disclosure, I have seen this talk and read Wlaschins book, but not in a long time, so maybe he did cover this and I forgot.)Eg given:    validate
    and-then update-db
    and-then send-email

What about when validate fails? The error is returned to the caller, which is
maybe suitable. What about when update-db fails? Should there be a retry? Try
another service? Requeue? Tell the user? What about if the send-email fails?Dont you end up with (except with more unwrapping and sub branches)   validate
   and-then update-db
   and-then send-email
   and-if (Ok, ok)
   or-if (ValidationError, notify-user)
   or-if (DBError, retry-in-5 or-then retry-remote or-then notify-user)
   or-if (EmailFailed, requeue-email and ok)

Maybe thats ok?