fix(embark/dashboard): fix dashboard not printing repl errors

This commit is contained in:
Jonathan Rainville 2019-03-13 11:36:23 -04:00 committed by Iuri Matias
parent dddc9d0cf6
commit dd1133d9cf
1 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,11 @@ class REPL {
enhancedEval(cmd, context, filename, callback) { enhancedEval(cmd, context, filename, callback) {
this.events.request('console:executeCmd', cmd.trim(), function (err, message) { this.events.request('console:executeCmd', cmd.trim(), function (err, message) {
callback(err, message === undefined ? '' : message); // This way, we don't print undefined if (err) {
// Do not return as the first param (error), because the dashboard doesn't print errors
return callback(null, err.red);
}
callback(null, message === undefined ? '' : message); // This way, we don't print undefined
}); });
} }