-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migration error does not get caught #3044
Migration error does not get caught #3044
Comments
you can write your log like this https://github.com/strongloop/loopback-next/tree/master/examples/log-extension |
@sbacem |
I was able to reproduce the problem using MySQL connector.
This may be a design problem in juggler, where the DataSource and/or the connectors don't correctly propagate connection errors from the connection pool to the method that triggered initiation of the connection. |
Opened a PR to fix this issue - see loopbackio/loopback-datasource-juggler#1756 |
Steps to reproduce
Current Behavior
The callback function in the catch block in migrate.ts, which should handle the error, does not get called. I am talking about this piece of code:
migrate(process.argv).catch(err => { console.error('Cannot migrate database schema', err); process.exit(1); });
Expected Behavior
In the example the message "Cannot migrate database schema" should appear in the console. In my production application I want to write the error messages in a logfile when you cannot connect to the database.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: