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
Thrown error no longer propagates (caught in the try-catch inside invokeTask in patchEventTarget in events.ts) #41867
Comments
@br-star , could you share are reproduce repo? The error should be rethrown by the following code.
And you can catch it by using
|
In my callstack, it goes through
|
@br-star , in that case, the behavior doesn't change by this #41562 (comment) commit, the error will be re-thrown, and it will be caught by the |
I'm a little confused, where is it re-throwing? invokeTask catches the error, doesn't store it anywhere, returns it, and
doesn't read the return value? |
On you are right, the code is not handled right here since the recent refactor, I will fix it. Thanks. |
Thanks! |
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
Close angular#41867 In the previous commit angular#41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown.
…ly (#41868) Close #41867 In the previous commit #41562 (comment), the error thrown in the event listener will be caught and re-thrown, but there is a bug in the commit, if there is only one listener for the specified event name, the error will not be re-thrown, so this commit fixes the issue and make sure the error is re-thrown. PR Close #41868
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I have an application that performs validation on mouse events. If validation fails, it throws an Error. We catch thrown errors in our application by doing:
window.addEventListener('error', (event) => { handleUncaughtError(event, logger); });
This worked fine: task.invoke() in the below code would call into our code, which would throw an error and would be caught by the above listener.
However, now the callsite for task.invoke() looks like:
and it seems like the error is ignored in globalCallback()
IIUC, this is caused by the fix for this #41562 (comment)
This is a regression (I tested with a version from 3 weeks ago and it worked as expected).
Can we ensure that all caught errors are rethrown? Or whatever is the Angular way to undo this regression.
The text was updated successfully, but these errors were encountered: