Skip to content

fix(core): properly handle async errors in addPluginListener#14464

Merged
Legend-Master merged 2 commits into
tauri-apps:devfrom
funnydino:fix/addpluginlistener-async-error-handling
Nov 15, 2025
Merged

fix(core): properly handle async errors in addPluginListener#14464
Legend-Master merged 2 commits into
tauri-apps:devfrom
funnydino:fix/addpluginlistener-async-error-handling

Conversation

@funnydino
Copy link
Copy Markdown
Contributor

The previous implementation used .then() after invoke() without await, which prevented the catch block from handling rejected promises. Now using await to properly catch errors and allow fallback to camelCase registerListener method.

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

The addPluginListener function doesn't properly catch async errors because .then() is called on the Promise without await, preventing the catch block from handling rejected promises.

What is the new behavior?

Now using await before invoke() calls to properly catch async errors and allow fallback to the camelCase registerListener method.

Does this PR introduce a breaking change?

No

@funnydino funnydino requested a review from a team as a code owner November 14, 2025 15:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 14, 2025

Package Changes Through bb2841a

There are 1 changes which include @tauri-apps/api with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.9.0 2.9.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

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

Thanks! (force pushed for the code sign requirement we had to merge, hope you don't mind)

funnydino and others added 2 commits November 15, 2025 12:04
The previous implementation used .then() after invoke() without await, which prevented the catch block from handling rejected promises. Now using await to properly catch errors and allow fallback to camelCase registerListener method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants