Skip to content

Commit

Permalink
Clean up error reporting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Oct 14, 2024
1 parent dd374c0 commit 6019e2f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mink-plugin/mink.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ function log (...messages) {
console.log(msg)
}
}
}

function logWithTrace (...messages) {
log(messages)
console.log('Stack Trace:')
console.log(new Error().stack)
// console.trace()
console.trace()
}

function inDevelopmentMode () {
Expand Down Expand Up @@ -326,8 +331,8 @@ async function fetchTimeMap (uri, tabid) {
setTimemapInStorage(data, data.original)
})
.catch(function(err) {
console.log(`Error fetching ${uri}`)
console.log(err.message)
logWithTrace(`Error fetching ${uri}`)
// console.log(err.message)

if (err.name === 'ZeroMementos') {
showInterfaceForZeroMementos(tabid)
Expand Down Expand Up @@ -523,7 +528,6 @@ chrome.webRequest.onHeadersReceived.addListener(function (deets) {
if (cachedTMKeys.length > 10) { // Keep the cache to a reasonable size through random deletion
log('******* Number of cached URL Headers:')
const indexToRemove = Math.floor(Math.random() * cachedTMKeys.length)
console.log('foo')
const keyOfIndex = cachedTMKeys[indexToRemove]
delete data[keyOfIndex]
}
Expand Down

0 comments on commit 6019e2f

Please sign in to comment.