Matt Blair

Matt Blair

I read that you learn more from a poor example than from a correct one. I don't believe this but that means my site will be a success.

Instrumenting Backbone for better error handling

Instrumenting Backbone for better error handling

1-Minute Read

At work we’ve been having some issues tracking down some nasty client side bugs. We know they’re happening in our Backbone views, but we’ve been unable to locate them with any accuracy due to the errors bubbling all the way to the window.onerror handler.

Enter Stackbone. A simple bit of code to instrument Backbone’s event loops to better locate client side errors.

To use:

Stackbone.start({
  Backbone: Backbone
  jQuery: jQuery
  onError: function (err) {
    // ... log the error ...
  }
});

You can either Stackbone = require(‘stackbone’) or simply include the .js file in a script tag.

Enjoy!

Recent Posts

Categories

About

This theme was developed for Hugo.