New feature: offline JavaScript error caching
Posted Apr 2, 2014 | 2 min. (356 words)The Raygun JavaScript provider has received an update today containing a new feature – offline error caching for JavaScript. This was previously available for our iOS, Android and Windows Phone providers in addition to the Xamarin provider for iOS and Android, but the 1.8.0 update brings it to the web with the Raygun4JS provider.
Not much to it – if a JS application throws an Error when network connectivity is not available, it’s saved to localStorage. When it comes up again, cached errors are sent so you never miss a thing. This is crucial on mobile platforms when a constant internet connection is not a given.
We’ve brought it to JavaScript initially to support WinJS, which this release also officially debuts. Next on the roadmap is support for other JavaScript mobile app development frameworks – look out for more announcements about this soon! We’ve got a couple in mind, but if you have a favorite JS app dev framework you’d like to use with Raygun4JS let us know in the comments below.
Easy to use offline JavaScript error tracking
Enabling offline caching is simple and can be done with the following function call:
Raygun.init('apikey').attach().saveIfOffline(true);
Couldn’t be simpler! Saved errors will retain all data including the time they were generated at.
This feature is fully supported in all modern (self-updating) browsers like Chrome, Opera, Firefox and IE 10 and 11. Some support is also available for IE 8 and 9 – errors will be saved if the initial post to the Raygun API times out.
The new 1.8.0 release is available now from Bower and NuGet so you can grab it immediately.
Add Raygun to your JavaScript app now
If you want to get visibility on your JS errors, there’s a 14 day free trial of Raygun available here, no credit card needed. It’ll take less than a couple of minutes to add as the library is available from NuGet and Bower and there’s only a couple of lines of JS to add. If you have any thoughts or feedback on Raygun’s JavaScript error reporting leave them below and we’ll get back to you. Until next time!