Unclear documentation for handleError
For handleError, it's unclear from the documentation what will happen if you throw an error from within the handleError method.
Is the following enough to abort execution automatically? handleError(context) => { throw new Error("Stop Processing!"); }
Or would we need to add in an extra call to context.abort?: handleError(context) => { context.abort(); throw new Error("Stop Processing!"); }
Similarly, for timeout it could be a little clearer at what point ATTEMPT_TIMEOUT will be thrown.
In the example shown where a time out of 1000ms is shown, if the function that's being wrapped takes 2000ms, at what point is the ATTEMPT_TIMEOUT error thrown?
Is it thrown at 1000ms (when the timeout expires)?
Is it thrown at 2000ms regardless of whether or not the function resolves to a completed status?
Or is it thrown at 2000ms only if the inner function throws an error or has a rejected promise?