Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear documentation for handleError #56

Open
timtucker-dte opened this issue Oct 13, 2022 · 1 comment
Open

Unclear documentation for handleError #56

timtucker-dte opened this issue Oct 13, 2022 · 1 comment

Comments

@timtucker-dte
Copy link

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!");
}

@timtucker-dte
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant