Skip to content

Commit b19d586

Browse files
kirklandsignfacebook-github-bot
authored andcommitted
throw Java exception when execution fails (#3112)
Summary: Pull Request resolved: #3112 Instead of logging, we throw a java exception and let user catch it. Reviewed By: dbcakadbc Differential Revision: D56270287 fbshipit-source-id: 9c581fb384c671ca14d2a4a8946654569ae953a6
1 parent 203ae40 commit b19d586

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extension/android/jni/jni_layer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ class ExecuTorchJni : public facebook::jni::HybridClass<ExecuTorchJni> {
325325
#endif
326326

327327
if (!result.ok()) {
328-
ET_LOG(
329-
Error,
328+
facebook::jni::throwNewJavaException(
329+
"java/lang/Exception",
330330
"Execution of method %s failed with status 0x%" PRIx32,
331331
method.c_str(),
332332
static_cast<error_code_t>(result.error()));

0 commit comments

Comments
 (0)