Subject=Re: Re: Promises: final steps
# Domenic Denicola (12 years ago)
As your example points out, being unhandled is a changing state. All rejections start out unhandled, but can become handled either immediately or in a later turn. The only time in which you can be sure a rejection is unhandled is when the promise is garbage collected, which may never happen (but usually does).
This is an interesting avenue. The problem is the chain-ability and value like nature of promises. It is difficult to truly determine that the error has not been handled. The error may be handled later down the chain or in a separate context. When is the decision made that the error has not been handled? Is the error determined not handled on garbage collection? Is there a ttl on error handling? This is a curious case, but if feasible would be the most elegant option.
rejectedPromise = promise.then(func) .then(func) //Error swallowed .then(func); setTimeout(function () { rejectedPromise.then(func, errorHandler); //Finally handle it }, 20000);