The more context you have around an error, the better it'll help you when debugging. And who understands your application's context better than you!
Starting today, you will be able to record custom information with your errors. It's super simple too! Just create an
_errs.meta object, and add anything you want to it!
You can pass the
_errs.meta object any number of properties, and the values can either be strings, numbers or booleans. Values with other types will be ignored.
You can even add and remove properties from the
_errs.meta object at runtime. So, if your user changes his or her preferences about cats while using your application, you can set
_errs.meta.lovesCats = false; when that happens. The tracking script will record the new value
lovesCats from that point on whenever an error occurs.
This can be a huge help when debugging your code. Imagine if you could record which user got the error, which action the user was performing at the time, and on which area of your page!
There have also been several improvements to the tracking code. Two hard-to-find bugs have been squashed, overall performance has been improved, browser support has been expanded, resilience has been improved in case our servers are in the middle of a hurricane, and the code is much better tested now. All of this while reducing the code size! (Ok, it only reduced by 4 bytes, but it's something, right?) Just to remind you, the code size doesn't really effect you, because the tracking script doesn't come in the way of your page load time at all, giving you maximum performance at all times.
As always, feedback welcome. I can't wait to see what you will do with this ability to record custom data.
The custom data recorded is put into the same store as the one used for raw error data and shares the same limits. That is, you can currently put in upto 25 MB of data. Beyond that, older data is purged to make room for the new data.