Skip to content

Commit

Permalink
[fixes #6965] Display underlying raw error on fail to lift app (#6966)
Browse files Browse the repository at this point in the history
* Display underlying `raw` error on fail to lift app

Some lift errors (e.g. `sails-mysql` initialisation errors) include a `.raw` more details error
message which is important i.e. specific model errors which cannot be corrected without 
the message details. This change displays these messages if they are present.

Closes #6965.

* Correct code formatting
  • Loading branch information
danielsharvey authored May 13, 2020
1 parent 9af6826 commit bab841e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/app/lift.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ module.exports = function lift(configOverride, done) {
done = done || function defaultCallback(err) {
if (err) {
sails.log.error('Failed to lift app:',err);
if(err.raw) {
sails.log.error('More details (raw):', err.raw);
}
sails.log.silly('(You are seeing the above error message because no custom callback was programmatically provided to `.lift()`.)');
return;
}
Expand Down

0 comments on commit bab841e

Please sign in to comment.