Reducing Noisy JavaScript Errors with Rollbar

The docs didn't make it very clear exactly what I should do so here is my fix

Recently on a project we were getting lots of noisy JavaScript errors caused by a specific issue with the Safari browser over which we had no control. Rollbar has a config option which allows you to ignore specific error messages which was perfect. The issue was I just couldn’t get it formatted correctly, so I thought it would be useful to share how I got it working.

It seemed like I need to pass the error message string with any characters that needed to be escaped escaped (Here is a link for the full documentation about ignoring specific exception messages). This was not working for me. When I made the string into a regex I was able to get it working.

Here is my code for browser JS:

  var _rollbarConfig = {
    accessToken: ... // Other config code
    ignoredMessages: [/undefined is not an object \(evaluating 'r\[\"@context\"\]\.toLowerCase'\)/]
  };

Recent posts View all

JavaScript

Setting a more specific database type in Prisma

Prisma sets a default of TEXT for all String fields, here is how you can override that.

Ruby

Override database attribute types

Sometimes you don't have control over how your database handles information, so you need Rails to set it