Mutations util: Isolate callback errors #1512
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Wraps callbacks passed to the mutations util in try-catch so they don't impact each other when they throw.
See #1508.
Closes #1509.
Function could, essentially equivalently, be
const isolateErrors = async func => func(), basically as a more-self-documenting #1509—if anything I think in some browsers and circumstances that actually makes the error log better, compared toconsole.error, if I recall correctly.Testing steps
You know... I'm not sure of a great way to reliably trigger the scenario to test this? I can maybe hack something together to ensure that modifiers get called in a certain order to demonstrate the problem. The place I ran into it was
createCaughtUpLinethrowing with a null input, per #1488, and breaking the boring tag chiclets tweak.