You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
done() callbacks aren't supposed to throw exceptions, but they might, because bugs. If this happens, the exception just bubbles up into the reject() call where it shouldn't end up, because reject() isn't supposed to throw exceptions. The resolution and consumption parts should be strictly separated and not affect each other. One solution is to use trigger_error($exception, E_USER_ERROR); instead.
Additionally, an error handler could be used similar to the one proposed in async-interop to allow users to catch and log these errors but continue execution.
The following code snippet demonstrates reject() throwing while it's not supposed to throw.
done()
callbacks aren't supposed to throw exceptions, but they might, because bugs. If this happens, the exception just bubbles up into thereject()
call where it shouldn't end up, becausereject()
isn't supposed to throw exceptions. The resolution and consumption parts should be strictly separated and not affect each other. One solution is to usetrigger_error($exception, E_USER_ERROR);
instead.Additionally, an error handler could be used similar to the one proposed in
async-interop
to allow users to catch and log these errors but continue execution.The following code snippet demonstrates
reject()
throwing while it's not supposed to throw.The text was updated successfully, but these errors were encountered: