Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
fix: add error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanson-nr committed Jul 20, 2022
1 parent 2827045 commit 21448fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/@newrelic/gatsby-theme-newrelic/pages/404.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,13 @@ const search = async (searchTerm, token) => {

return records.page;
} catch (err) {
console.error(err);

const nr = window.newrelic;
if (nr) {
nr.noticeError(err);
} else {
// eslint-disable-next-line no-console
console.error(err);
}
return [];
}
};
Expand Down

0 comments on commit 21448fb

Please sign in to comment.