Skip to content

fix(core): Handle synchronous errors in PendingTasks.run function#68956

Open
atscott wants to merge 1 commit into
angular:mainfrom
atscott:syncerrrun
Open

fix(core): Handle synchronous errors in PendingTasks.run function#68956
atscott wants to merge 1 commit into
angular:mainfrom
atscott:syncerrrun

Conversation

@atscott
Copy link
Copy Markdown
Contributor

@atscott atscott commented May 27, 2026

catches synchronous errors coming out of the function passed to PendingTasks.run

catches synchronous errors coming out of the function passed to PendingTasks.run
@atscott atscott added the target: patch This PR is targeted for the next patch release label May 27, 2026
@atscott atscott requested a review from dgp1130 May 27, 2026 20:26
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label May 27, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 27, 2026
const removeTask = this.add();
fn().catch(this.errorHandler).finally(removeTask);
try {
fn().catch(this.errorHandler).finally(removeTask);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darn, I think we're just a month or two short of being able to use Promise.try: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think I misremembered 1.5 years instead of 2.5 years.

Didn't know they updated that site with an expected widely available date, that's useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants