Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw err;
} else {
err._babel = true;
}
let message = (err.message = `${this.opts.filename}: ${err.message}`);
const loc = err.loc;
if (loc) {
const location = {
start: {
line: loc.line,
column: loc.column + 1,
},
};
err.codeFrame = codeFrameColumns(code, location, this.opts);
message += "\n" + err.codeFrame;
}
if (process.browser) {
// chrome has it's own pretty stringifier which doesn't use the stack property
// https://github.com/babel/babel/issues/2175
err.message = message;
}
if (err.stack) {
const newStack = err.stack.replace(err.message, message);
err.stack = newStack;
}
throw err;
}