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
Stimulus doesn't catch exceptions thrown from async controller actions. This means that
a) We don't get nice stimulus errors in the console
b) handleError is never called, so overriding it (e.g. to log errors to a monitoring system like Sentry or Azure App Insights) has no effect.
This happens because the call to user code (this.method.call(this.controller, actionEvent)) is not awaited, so it returns a Promise immediately, and escapes the try catch block.
I think this is really important, because without the ability to configure custom error handling that applies to all stimulus controller code, users running production apps wont have visibility into how their async actions are failing, without putting a try catch block into every one of those methods.
The text was updated successfully, but these errors were encountered:
Stimulus doesn't catch exceptions thrown from async controller actions. This means that
a) We don't get nice stimulus errors in the console
b) handleError is never called, so overriding it (e.g. to log errors to a monitoring system like Sentry or Azure App Insights) has no effect.
This happens because the call to user code (
this.method.call(this.controller, actionEvent)
) is not awaited, so it returns a Promise immediately, and escapes the try catch block.stimulus/src/core/binding.ts
Lines 74 to 84 in 5fd12c7
I think something like this would work:
I think this is really important, because without the ability to configure custom error handling that applies to all stimulus controller code, users running production apps wont have visibility into how their async actions are failing, without putting a try catch block into every one of those methods.
The text was updated successfully, but these errors were encountered: