Skip to content

Commit

Permalink
MWPW-143579 Log 404s to lana
Browse files Browse the repository at this point in the history
  • Loading branch information
meganthecoder committed Jun 27, 2024
1 parent 69e3c0b commit 4404a0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,10 @@ const miloLibs = setLibs(LIBS);
if (document.querySelector('.faas')) {
loadStyle('/styles/faas.css');
}
const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
if (entry.responseStatus === 404) window.lana?.log(`The resource ${entry.name} returned a 404 status.`, { tags: 'errorType=error,module=resource-404' });
});
});
observer.observe({ type: 'resource', buffered: true });
}());

0 comments on commit 4404a0b

Please sign in to comment.