errorMessage helper moved to utils

This commit is contained in:
Michael Bradley, Jr 2018-08-20 10:36:29 -05:00
parent c8cd5f4229
commit f66552b044
2 changed files with 13 additions and 11 deletions

View File

@ -3,19 +3,10 @@ const fs = require('../core/fs');
const ProcessWrapper = require('../core/processes/processWrapper');
const webpack = require('webpack');
const writeFile = require('util').promisify(require('fs').writeFile);
const {errorMessage} = require('../utils/utils');
let webpackProcess;
function errorMessage(e) {
if (typeof e === 'string') {
return e;
} else if (e && e.message) {
return e.message;
} else {
return e;
}
}
class WebpackProcess extends ProcessWrapper {
constructor(options) {
super(options);

View File

@ -458,6 +458,16 @@ function interceptLogs(consoleContext, logger) {
};
}
function errorMessage(e) {
if (typeof e === 'string') {
return e;
} else if (e && e.message) {
return e.message;
} else {
return e;
}
}
module.exports = {
joinPath,
dirname,
@ -499,5 +509,6 @@ module.exports = {
groupBy,
sample,
last,
interceptLogs
interceptLogs,
errorMessage
};