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
Looking at the code for callWithErrorHandling, it has a try/catch block which will call handleError when an error occurs.
However, handleError will then try to process the error with callWithErrorHandling again, which leads to infinite recursion, causing RangeError Maximum call stack size exceeded.
Aside from making sure the custom error handler doesn't ever throw any errors, can we maybe prevent within Vue that callWithErrorHandling will not be called again recursively if it itself has errored?
The text was updated successfully, but these errors were encountered:
Thanks for reporting this — I agree this can easily lead to subtle infinite recursion, especially when user-defined global error handlers introduce unexpected behavior (or even just logging tools that throw).
One possible approach to mitigating this could be to track an internal flag during callWithErrorHandling, for example:
This is a common pattern to prevent re-entrancy in error-handling code, and I believe it could help prevent stack overflows without interfering with normal error propagation.
You should still ensure that yuor custom error handlers are resilient and don't throw — but safeguarding at the framework level could improve developer experience significantly.
Looking at the code for
callWithErrorHandling
, it has atry/catch
block which will callhandleError
when an error occurs.However,
handleError
will then try to process the error withcallWithErrorHandling
again, which leads to infinite recursion, causingRangeError Maximum call stack size exceeded
.Aside from making sure the custom error handler doesn't ever throw any errors, can we maybe prevent within Vue that
callWithErrorHandling
will not be called again recursively if it itself has errored?The text was updated successfully, but these errors were encountered: