Skip to content

Commit

Permalink
Spit out the awesome error message we get from babel as context
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Apr 12, 2018
1 parent 09bf748 commit 8a3f81b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,12 @@ AndroidBuilder.prototype.copyResources = function copyResources(next) {
fs.writeFile(to, newContents, cb2);
}
} catch (err) {
cb2(err); // surface parse/transform issues up callback stack!
err.message.split('\n').forEach(this.logger.error);
if (err.codeFrame) { // if we have a nicely formatted pointer to syntax error from babel, use it!
this.logger.log(err.codeFrame);
}
this.logger.log();
process.exit(1);
}
})(r, from, to, cb);
})(from, to, done);
Expand Down
7 changes: 6 additions & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5831,7 +5831,12 @@ iOSBuilder.prototype.copyResources = function copyResources(next) {
}
cb2();
} catch (err) {
cb2(err); // surface parse/transform issues up callback stack!
err.message.split('\n').forEach(this.logger.error);
if (err.codeFrame) { // if we have a nicely formatted pointer to syntax error from babel, use it!
this.logger.log(err.codeFrame);
}
this.logger.log();
process.exit(1);
} finally {
this.unmarkBuildDirFile(to);
}
Expand Down

0 comments on commit 8a3f81b

Please sign in to comment.