color emulator errors

This commit is contained in:
Nik Graf 2017-08-15 13:04:22 +02:00
parent 8fc34f6751
commit 699b9bcfef
No known key found for this signature in database
GPG Key ID: 7A97512F916175F1

View File

@ -5,6 +5,7 @@ const chalk = require('chalk');
const colorPrefix = chalk.hex('#bdb018');
const colorDim = chalk.hex('#777777');
const colorError = chalk.hex('#e22836');
const spaceSmall = ' ';
const prefix = colorPrefix(` Serverless${spaceSmall}`);
@ -16,7 +17,9 @@ const processMessage = rawMessage => {
msg = msg.trim();
if (msg.startsWith('Error:')) {
msg = `Function failed due to an error:${os.EOL}${os.EOL}${colorDim(msg)}${os.EOL}`;
msg = `${colorError('Function failed due to an error:')}${os.EOL}${os.EOL}${colorDim(
msg
)}${os.EOL}`;
}
}