Skip to content

Commit 5372b97

Browse files
lavenzgfacebook-github-bot
authored andcommitted
Record sourceURL in exception message when compiling JS failed
Summary: Its useful to see on which JS file that the compiling error happens. Reviewed By: OmarBafagih Differential Revision: D78794860 fbshipit-source-id: 42ee194ce5d8fb0c0d5dfd0d39ddbbf00a256758
1 parent 8b38455 commit 5372b97

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

API/hermes/hermes.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,9 +1673,13 @@ HermesRuntimeImpl::prepareJavaScriptWithSourceMap(
16731673
#endif
16741674
}
16751675
if (!bcErr.first) {
1676-
LOG_EXCEPTION_CAUSE("Compiling JS failed: %s", bcErr.second.c_str());
1676+
LOG_EXCEPTION_CAUSE(
1677+
"Compiling JS failed: %s, sourceURL: %s",
1678+
bcErr.second.c_str(),
1679+
sourceURL.c_str());
16771680
throw jsi::JSINativeException(
1678-
"Compiling JS failed: " + std::move(bcErr.second));
1681+
"Compiling JS failed: " + std::move(bcErr.second) +
1682+
", sourceURL: " + sourceURL);
16791683
}
16801684
return std::make_shared<const HermesPreparedJavaScript>(
16811685
std::move(bcErr.first), runtimeFlags, std::move(sourceURL));

0 commit comments

Comments
 (0)