Skip to content

Commit

Permalink
Omit stacks with an untracable file name (#82)
Browse files Browse the repository at this point in the history
Closes #81

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops authored Oct 29, 2024
1 parent 37b48fb commit 399b3bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export default function whyIsNodeRunning (logger = console) {
}

function printStacks (asyncResource, logger) {
const stacks = asyncResource.stacks.filter((stack) => !stack.getFileName().startsWith('node:'))
const stacks = asyncResource.stacks.filter((stack) => {
const fileName = stack.getFileName()
return fileName !== null && !fileName.startsWith('node:')
})

logger.error('')
logger.error(`# ${asyncResource.type}`)
Expand Down

0 comments on commit 399b3bf

Please sign in to comment.