mirror of https://github.com/status-im/metro.git
[react-packager] Don't depend on error.stack being available
This commit is contained in:
parent
f88167157c
commit
408160de7d
|
@ -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