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

Improve error message when database connection fails #1243

Closed
timleslie opened this issue May 26, 2019 · 2 comments
Closed

Improve error message when database connection fails #1243

timleslie opened this issue May 26, 2019 · 2 comments

Comments

@timleslie
Copy link
Contributor

At the moment if you fail to connect to the database, you'll get something like this:

✖ Connecting to database
Error: Post connection error
    at /Users/stunjiturner/Downloads/Code/keystone-5/demo-projects/blog/node_modules/@keystone-alpha/utils/dist/utils.cjs.dev.js:72:21
    at async executeDefaultServer (/Users/stunjiturner/Downloads/Code/keystone-5/demo-projects/blog/node_modules/@keystone-alpha/keystone/bin/utils.js:108:3) {
  errors: {
    MongooseAdapter: Error: Post connection error
        at MongooseAdapter.connect (/Users/stunjiturner/Downloads/Code/keystone-5/demo-projects/blog/node_modules/@keystone-alpha/keystone/lib/adapters/index.js:31:23)
        at processTicksAndRejections (internal/process/task_queues.js:89:5)
        at async pReflect (/Users/stunjiturner/Downloads/Code/keystone-5/demo-projects/blog/node_modules/p-reflect/index.js:5:17)
        at async Promise.all (index 0)
        at async executeDefaultServer (/Users/stunjiturner/Downloads/Code/keystone-5/demo-projects/blog/node_modules/@keystone-alpha/keystone/bin/utils.js:108:3) {
      errors: [Array]
    }
  }
}
error Command failed with exit code 1.

The actual error message which caused the failure is hidden within the line errors: [Array]. We need to improve the way we report these errors so that the vital info is not lost.

See #1231

@dcousens dcousens added the dx label May 27, 2019
@nonfungibletunji
Copy link

what is the error, how can it be fixed.

@stale
Copy link

stale bot commented Feb 7, 2020

It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)

@stale stale bot added the needs-review label Feb 7, 2020
@stale stale bot closed this as completed Feb 2, 2021
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

4 participants