julianrubisch / better-stimulus

An opinionated collection of StimulusJS best practices
https://www.betterstimulus.com
277 stars 17 forks source link

reorganize text and expand on the solution #47

Closed adrienpoly closed 4 years ago

adrienpoly commented 4 years ago

Hey

I started to comment on the initial PR but found it easier finally to open a new PR on yours as I wanted to suggest several significant changes.

Stimulus includes a largely undocumented global error handler (see links below) that catches errors when Stimulus invokes your application code in internal try/catch blocks.

as it is not as magic as that but only a result of the newly defined errorHandler function in the ApplicationController

Basically the idea is lets make sure we collect all the issues in the same place and format them correctly. Then once we have this single point let's dispatch this source to a dedicated service.

Feel free to comment/edit etc

julianrubisch commented 4 years ago

This is such great feedback, thanks!