A practical guide to building an ErrorFeedback JavaScript class that catches unhandled errors and promise rejections, then displays them in a dismissible banner. The class uses window.onerror and window.onunhandledrejection to intercept errors, shows a configurable message banner that auto-dismisses after 5 seconds, and can be extended to integrate with error monitoring services like Appsignal or Honeybadger. Aimed at Rails developers using Hotwire/Stimulus who want to improve UX when JavaScript fails silently.

4m read timeFrom railsdesigner.com
Post cover image
Table of contents
The silence of the errorsHello noisy errorsEnable the bannerWhere to go from here

Sort: