Skip to content

Conversation

michaelbromley
Copy link
Contributor

Currently the same error message is displayed regardless of the underlying
cause of failure . This change also outputs the Error.stack string to the
logger.

Fixes #30

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x ] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • Tests for the changes have been added (for bug fixes / features)
    (no tests in this project)
  • Docs have been added / updated (for bug fixes / features)
    (no specific docs in this project

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

When attempting to connect using the handleRetry operator, all error information from TypeORM is swallowed and a generic "Unable to connect to the database" message is displayed.

Any number of things can cause the TypeORM createConnection function to fail - invalid credentials, incorrectly defined entities, database unreachable etc. Without this information the developer is left guessing.

Issue Number: #30

What is the new behavior?

The stack trace of the error object is also passed to the logger (rather than an empty string). This gives enough information to the developer to know what the particular failure was.

Does this PR introduce a breaking change?

[ ] Yes
[x ] No

Currently the same error message is displayed regardless of the underlying
cause of failure . This change also outputs the Error.stack string to the
logger.

Fixes nestjs#30
@kamilmysliwiec
Copy link
Member

Great job @michaelbromley 🙂

@kamilmysliwiec kamilmysliwiec merged commit a21f4e2 into nestjs:master Jun 22, 2018
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

Successfully merging this pull request may close these issues.

Looks like TypeORM error message are suppressed.
2 participants