Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise rejections swallow stack traces #158

Open
hdon opened this issue May 22, 2019 · 1 comment
Open

Promise rejections swallow stack traces #158

hdon opened this issue May 22, 2019 · 1 comment

Comments

@hdon
Copy link

hdon commented May 22, 2019

Note: The title of this issue has changed

hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~$ mkdir migrate-project
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~$ cd migrate-project/
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ npm i migrate
npm WARN saveError ENOENT: no such file or directory, open '/home/hdon/migrate-project/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/hdon/migrate-project/package.json'
npm WARN migrate-project No description
npm WARN migrate-project No repository field.
npm WARN migrate-project No README data
npm WARN migrate-project No license field.

+ [email protected]
added 20 packages from 13 contributors and audited 21 packages in 0.948s
found 0 vulnerabilities

hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate init
  migrations dir : /home/hdon/migrate-project/migrations
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate create a
  create : /home/hdon/migrate-project/migrations/1558494641607-a.js
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ cat > migrations/1558494641607-a.js
exports.up = function foobar() { return Promise.reject('yay!') }
exports.down = () => Promise.resolve()
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate up
  up : 1558494641607-a.js
  error : yay!

Is there a debug switch to get a stack trace? I tend to think they're useful...

@hdon hdon changed the title Promise rejections are ignored Promise rejections swallow stack traces May 22, 2019
@wesleytodd
Copy link
Collaborator

Yep, I want to refactor the logging. The original way was preserved mostly intact for the 1.0 release, and I think that was a mistake. Maybe I can set aside some time soon to put together a 2.0 to change the logging. I will leave this open until we can resolve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants