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

Print stack to trace where the warning comes from #6155

Merged
merged 1 commit into from
Dec 15, 2016

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Dec 12, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

#5691

Auditors: @mrose17, @bbondy

(node:36404) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
DeprecationWarning: Calling an asynchronous function without callback is deprecated.
    at maybeCallback (fs.js:95:42)
    at Object.fs.appendFile (fs.js:1237:14)
    at debug (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:30:6)
    at Object.exports.updateUrl (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:52:3)
    at Object.exports.init (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:91:25)
    at PackageLoader.load (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/index.js:732:15)
    at fs.readFile (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/package-loader.js:16:5)
    at tryToString (fs.js:425:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:412:12)
(node:36404) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
DeprecationWarning: Calling an asynchronous function without callback is deprecated.
    at maybeCallback (fs.js:95:42)
    at Object.fs.appendFile (fs.js:1237:14)
    at debug (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:30:6)
    at Object.exports.init (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:94:5)
    at PackageLoader.load (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/index.js:732:15)
    at fs.readFile (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/package-loader.js:16:5)
    at tryToString (fs.js:425:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:412:12)
(node:36404) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
DeprecationWarning: Calling an asynchronous function without callback is deprecated.
    at maybeCallback (fs.js:95:42)
    at Object.fs.appendFile (fs.js:1237:14)
    at debug (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:30:6)
    at AutoUpdater.autoUpdater.on (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:246:3)
    at emitTwo (events.js:106:13)
    at AutoUpdater.emit (events.js:191:7)
    at Object.exports.init (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:98:19)
    at PackageLoader.load (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/index.js:732:15)
    at fs.readFile (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/package-loader.js:16:5)
    at tryToString (fs.js:425:3)

@darkdh darkdh force-pushed the cr54-warning-stack branch from c4a7d25 to a77be92 Compare December 15, 2016 03:12
@@ -36,6 +36,8 @@ process.on('unhandledRejection', function (error, promise) {
handleUncaughtError(error)
})

process.on('warning', warning => console.warn(warning.stack))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should also print warning.message first?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it has already printed name: message + stack. Ex.

DeprecationWarning: Calling an asynchronous function without callback is deprecated.
    at maybeCallback (fs.js:95:42)
    at Object.fs.appendFile (fs.js:1237:14)
    at debug (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:30:6)
    at Object.exports.updateUrl (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:52:3)
    at Object.exports.init (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:91:25)
    at PackageLoader.load (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/index.js:732:15)
    at fs.readFile (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/package-loader.js:16:5)
    at tryToString (fs.js:425:3)

It would be like this after added

DeprecationWarning
Calling an asynchronous function without callback is deprecated.
DeprecationWarning: Calling an asynchronous function without callback is deprecated.
    at maybeCallback (fs.js:95:42)
    at Object.fs.appendFile (fs.js:1237:14)
    at debug (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:30:6)
    at AutoUpdater.autoUpdater.on (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:246:3)
    at emitTwo (events.js:106:13)
    at AutoUpdater.emit (events.js:191:7)
    at Object.exports.init (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/updater.js:98:19)
    at PackageLoader.load (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/index.js:736:15)
    at fs.readFile (/Users/darkdh/Projects/browser-laptop-bootstrap2/src/browser-laptop/app/package-loader.js:16:5)
    at tryToString (fs.js:425:3)

Plus node's warning message might be too many of them

(node:18561) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

@bbondy
Copy link
Member

bbondy commented Dec 15, 2016

ok

@bbondy bbondy merged commit 814b46b into brave:chromium54 Dec 15, 2016
@luixxiul luixxiul added this to the 0.13.0 milestone Jan 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants