This is PromiseR with added functionality for tracking errors
in a typed fashion, rather than just pushing everything into
thx.Error and using unchecked error handlers.
The rationale for this change is that it is difficult to distinguish
between fatal errors that should be opaque to the user, and errors
which the end-user can be reasonably expected to correct. For the
former category, the only reasonable behavior may be to retry
the same request; for the latter, the user should modify their
calling behavior in order to ensure a correct result. While
PromiseR is adequate for the former, it does not communicate the
latter case clearly in its type. In any real system, we need both
varieties of error handling, hence this commit.
This is PromiseR with added functionality for tracking errors in a typed fashion, rather than just pushing everything into thx.Error and using unchecked error handlers.
The rationale for this change is that it is difficult to distinguish between fatal errors that should be opaque to the user, and errors which the end-user can be reasonably expected to correct. For the former category, the only reasonable behavior may be to retry the same request; for the latter, the user should modify their calling behavior in order to ensure a correct result. While PromiseR is adequate for the former, it does not communicate the latter case clearly in its type. In any real system, we need both varieties of error handling, hence this commit.