if (!mapboxgl.accessToken) {
logError('[Map]: Access token is missing');
setHasError(true);
}
In my rollbar conf
var _rollbarConfig = {
accessToken: "TOKEN",
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: "development",
client: {
javascript: {
source_map_enabled: true,
guess_uncaught_frames: true
}
}
},
checkIgnore: function(isUncaught, args, payload) {
var error = args[0];
if (error && error.message) {
return false; // Do not ignore, send to Rollbar
}
return true; // Ignore all other errors
}
};
It seems to work ignoring all other errors client side in rollbar. For example, I triggered a hydration error that is not reported to rollbar with this checkIgnore function. It is reporting when removing the checkIgnore snippet.
However, the logError logError('[Map]: Access token is missing'); is not reporting at all, even when I'm triggering it. Can anyone spot the wrong in checkIgnore? How do I only report logError-hook to rollbar client side?
I have a hook called logError in my React code that reports to rollbar with rollbar.error.
It looks like this:
It is used like this in other components:
In my rollbar conf
It seems to work ignoring all other errors client side in rollbar. For example, I triggered a hydration error that is not reported to rollbar with this checkIgnore function. It is reporting when removing the checkIgnore snippet.
However, the logError
logError('[Map]: Access token is missing');
is not reporting at all, even when I'm triggering it. Can anyone spot the wrong in checkIgnore? How do I only report logError-hook to rollbar client side?