Exposing Recoverable Errors

Differential Revision: D4383792

fbshipit-source-id: e6d0f57fcaacf242e95bfcf589a4fa840c317fe5
This commit is contained in:
Ashok Menon 2017-01-10 07:04:53 -08:00 committed by Facebook Github Bot
parent 24f3add010
commit da428d6c3d
4 changed files with 4 additions and 4 deletions

View File

@ -397,7 +397,7 @@ void JSCExecutor::loadApplicationScript(
}
#endif
void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> script, std::string sourceURL) throw(JSException) {
void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> script, std::string sourceURL) {
SystraceSection s("JSCExecutor::loadApplicationScript",
"sourceURL", sourceURL);

View File

@ -62,7 +62,7 @@ public:
virtual void loadApplicationScript(
std::unique_ptr<const JSBigString> script,
std::string sourceURL) throw(JSException) override;
std::string sourceURL) override;
#ifdef WITH_FBJSCEXTENSIONS
virtual void loadApplicationScript(

View File

@ -18,7 +18,7 @@ namespace detail {
struct RecoverableError : public std::exception {
explicit RecoverableError(const std::string &what_)
: m_what {what_}
: m_what { "facebook::react::Recoverable: " + what_ }
{}
virtual const char* what() const throw() override { return m_what.c_str(); }

View File

@ -16,7 +16,7 @@ TEST(RecoverableError, RunRethrowingAsRecoverableRecoverTest) {
});
FAIL() << "Unthrown exception";
} catch (const RecoverableError &err) {
ASSERT_STREQ(err.what(), "catch me");
ASSERT_STREQ(err.what(), "facebook::react::Recoverable: catch me");
} catch (...) {
FAIL() << "Uncaught exception";
}