Skip to content

Commit

Permalink
Remove rejectionWarning logic
Browse files Browse the repository at this point in the history
It's due to a bug introduced in Node 12.6.0 but fixed in 12.7.0

nodejs/node#28540
  • Loading branch information
ehmicky committed Jul 31, 2019
1 parent 712074c commit 57415f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/handle/common.js
@@ -1,6 +1,5 @@
import { isLimited } from '../limit.js'
import { isRepeated } from '../repeat.js'
import { isRejectionWarning } from '../warnings.js'
import { getLevel } from '../level.js'
import { getError, addErrorPrint } from '../error/main.js'
import { exitProcess } from '../exit.js'
Expand Down Expand Up @@ -34,10 +33,6 @@ export const handleEvent = async function({
return
}

if (isRejectionWarning(name, event)) {
return
}

await logEvent({ opts, name, event })

await exitProcess({ name, opts })
Expand Down
11 changes: 0 additions & 11 deletions src/warnings.js
Expand Up @@ -46,14 +46,3 @@ const getWarningListeners = function() {
}

const warningListener = getWarningListener()

// Unhandled rejected promises emit a warning by default (unless
// --unhandled-rejections is used). This warning is not useful, so we remove it.
export const isRejectionWarning = function(name, { value }) {
return (
name === 'warning' &&
value instanceof Error &&
value.name === 'DeprecationWarning' &&
value.code === 'DEP0018'
)
}

0 comments on commit 57415f9

Please sign in to comment.