[react-packager] Don't depend on error.stack being available
This commit is contained in:
parent
9ea0002774
commit
3d2413a38a
|
@ -125,7 +125,7 @@ function formatError(err, filename, source) {
|
||||||
function formatGenericError(err, filename) {
|
function formatGenericError(err, filename) {
|
||||||
var msg = 'TransformError: ' + filename + ': ' + err.message;
|
var msg = 'TransformError: ' + filename + ': ' + err.message;
|
||||||
var error = new TransformError();
|
var error = new TransformError();
|
||||||
var stack = err.stack.split('\n').slice(0, -1);
|
var stack = (err.stack || '').split('\n').slice(0, -1);
|
||||||
stack.push(msg);
|
stack.push(msg);
|
||||||
error.stack = stack.join('\n');
|
error.stack = stack.join('\n');
|
||||||
error.message = msg;
|
error.message = msg;
|
||||||
|
|
Loading…
Reference in New Issue