Ignore unnecessary airbrake notices (#2283)
This commit is contained in:
parent
cc0e4b40dd
commit
c90be27677
2 changed files with 5 additions and 0 deletions
|
|
@ -687,9 +687,13 @@ var instantClick
|
|||
airbrake.addFilter(function(notice) {
|
||||
notice.context.environment = "<%= Rails.env %>";
|
||||
var file = notice.errors[0].backtrace[0].file;
|
||||
var randomNumber = Math.floor(Math.random() * 10);
|
||||
if ((file || "").startsWith("https://stats.pusher.com")) {
|
||||
return null;
|
||||
}
|
||||
if (randomNumber > 4) { // We don't need to collect every JS error.
|
||||
return null;
|
||||
}
|
||||
return notice;
|
||||
});
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -57,4 +57,5 @@ end
|
|||
|
||||
Airbrake.add_filter do |notice|
|
||||
notice.ignore! if notice[:errors].any? { |error| error[:type] == "Pundit::NotAuthorizedError" }
|
||||
notice.ignore! if notice[:errors].any? { |error| error[:type] == "ActiveRecord::RecordNotFound" }
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue