Skip to content

Commit e4afd0a

Browse files
psiddhGithub Executorch
andauthored
Summary: Throw appropriate Executorch exception which ic mapped to ap… (#13771)
…propriate native error code Test Plan: Tested with executorch-examples Reviewers: Subscribers: Tasks: Tags: ### Summary [PLEASE REMOVE] See [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests) for ExecuTorch PR guidelines. [PLEASE REMOVE] If this PR closes an issue, please add a `Fixes #<issue-id>` line. [PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: <area>" label. For a list of available release notes labels, check out [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests). ### Test plan [PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable. Co-authored-by: Github Executorch <[email protected]>
1 parent 216a1ec commit e4afd0a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

extension/android/jni/jni_layer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,7 @@ class ExecuTorchJni : public facebook::jni::HybridClass<ExecuTorchJni> {
308308
<< std::uppercase << static_cast<uint32_t>(result) << "]";
309309

310310
jni_helper::throwExecutorchException(
311-
static_cast<uint32_t>(
312-
Error::InvalidArgument), // For backward compatibility
313-
ss.str());
311+
static_cast<uint32_t>(result), ss.str());
314312
return {};
315313
}
316314
auto&& underlying_method = module_->methods_[method].method;
@@ -460,9 +458,7 @@ class ExecuTorchJni : public facebook::jni::HybridClass<ExecuTorchJni> {
460458
<< "]";
461459

462460
jni_helper::throwExecutorchException(
463-
static_cast<uint32_t>(
464-
Error::InvalidArgument), // For backward compatibility
465-
ss.str());
461+
static_cast<uint32_t>(Error::InvalidArgument), ss.str());
466462
return {};
467463
}
468464
const auto& methods = names_result.get();

0 commit comments

Comments
 (0)