Open ReneB opened 4 years ago
The build passes so there's that.
I've added 4 tests - 2 for the generic Promise
class and 2 for the nongeneric version - which test:
1) continuation (with the value encapsulated in the promise in the generic case) when a resolved promise is passed 2) rejection when a rejected promise is passed in
In the current version, the code is backwards incompatible for the specific case of Catch
blocks that throw and don't return anything, as mentioned in #77 - if you'd prefer a backwards compatible version I will rename the Catch
method to something like Recover
.
@RoryDungan could you take a look at this?
I support adding this feature. It was one of the big omissions when I used this library. I had to add it in my own fork.
… to allow asynchronous continuation
These versions of Catch allow for recovery of a chain of promises by handling an error from an earlier state, then getting back into the "normal" flow of processing.
Rework of PR #77.